AutocompleteTextfieldSwift icon indicating copy to clipboard operation
AutocompleteTextfieldSwift copied to clipboard

fatal error: unexpectedly found nil while unwrapping an Optional value

Open dipenshah210 opened this issue 8 years ago • 3 comments

Hey, I tried using your code for my application. Unfortunately when I click on button and the viewcontroller appears modally with navigation controller embedded in, it show the following error in AutocompleteTextfield.

fatal error: unexpectedly found nil while unwrapping an Optional value

The error occurs at following function:

public override func awakeFromNib() { super.awakeFromNib() commonInit() setupAutocompleteTable(superview!)

dipenshah210 avatar Aug 19 '16 09:08 dipenshah210

Same issue I am having. Any solution to this ?

Nidhee avatar Aug 22 '16 11:08 Nidhee

I tried to add one if condition in willMoveToSuperview() public override func willMoveToSuperview(newSuperview: UIView?) { super.willMoveToSuperview(newSuperview) commonInit() if let newSuperviews = newSuperview { setupAutocompleteTable(newSuperviews) } }

And it worked with me. it was not crashing.

Nidhee avatar Aug 22 '16 11:08 Nidhee

@Nidhee Thanks

anand-y avatar Oct 24 '16 06:10 anand-y