swift - iOS App Crashes in didFinishLaunchingWithOptions due to IBOutlet -
in ios app have initial viewcontroller 2 textfields login. if run application in debug mode code compiles , can see initial viewcontroller set on main storyboard.
in opposite if try run code in release app crashes calming outlet not set.
2017-04-07 13:55:53.422 sahin fruit[40068:1230157] *** terminating app due uncaught exception 'nsunknownkeyexception', reason: '[<uiviewcontroller 0x7fb5e2e0a450> setvalue:forundefinedkey:]: class not key value coding-compliant key emailtextfield.'
to overcome problem tries set initial vc in appdelegate programatically no result, app still crashes. idea?
self.window = uiwindow(frame: uiscreen.main.bounds) let initialviewcontroller = uistoryboard.viewcontrollerwithidentifier(main.loginvc.rawvalue, storyboardname: .main) self.window?.rootviewcontroller = initialviewcontroller self.window?.makekeyandvisible()
p.s: turned off optimisation in release see if no result.
this because must have copied viewcontroller in storyboard , assigned different class. right click on top of viewcontroller @ first square box(forgot exact name), , outlet ll shown yellow color triangle, delete it
, project build fine.
Comments
Post a Comment