New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All of a sudden... fatal error: unexpectedly found nil while unwrapping an Optional value #64
Comments
One of those must not be initialized. When is this being called? Before it's UI is initialized? |
I call setupDropdown() from viewDidLoad() In setupDropdown() I have this code:
Nothing has changed at all here or in the way I call it. Thanks for the crazy quick response! |
Can you tell which variable is nil that shouldn't be. Try swapping out some of the variables and see which one is the culprit, e.g. let myCell = cell, let myCellImage = cell.checkMarkIcon, etc., and see which one blows it up. In other parts of the source, I see "cell?.". Maybe the cell isn't initialized when you get here? I haven't updated my code yet so I don't know if I'd be able to reproduce this. I don't see anything obviously wrong with your setupDropdown(), which is consistent with this being a new issue post-update. I'm also not a contributor to the repo, just a fellow fan/user like you :-) |
Thanks for your help, Brian. The community appreciates it! I'm not sure if this is helpful, but simply commenting out this line eliminates the error.
For my specific application, not showing the checkmark isn't an issue. In fact I would prefer it that way actually. I'll keep messing around and see if I see anything else. Thanks again for your help! |
Fixed Issue PhamBaTho#64 Crash While Unwrapping SelectedIndex
Fixed issue #64: Crash while unwrapping selectedIndexPath
Love this library. Been using it for a while now, but after upgrading cocoapods and reinstalling all the pods, I know am hitting a strange error. Nothing else has changed, but this is now the issue I'm seeing:
cell.checkmarkIcon.hidden = (indexPath.row == selectedIndexPath) ? false : true
Running XCode 7.3.1 and the latest BTNavigationDropdownMenu
Any idea why this is happening? It could certainly be me, but I haven't been able to solve it for some time. Thanks!
kane
The text was updated successfully, but these errors were encountered: