ios - Unexpected found nil will unwrapping an Optional value occurs when setting a property of UITableView -
override func viewdidload() { super.viewdidload() tableview.separatorinset = uiedgeinsetszero tableview.tablefooterview = uiview() appdelegate = uiapplication.sharedapplication().delegate as! appdelegate initializefetchedresultscontroller() }
the line tableview.separatorinset = uiedgeinsetszero
executes fine, next line breaks apparently trying unwrap optional:
tableview.tablefooterview = uiview()
i ran problem. upon setting tableview footer programmatically seems reloaddata called, table begins looking data, , calls numberofsectionsintableview before viewdidload completes. if setting table data in viewdidload after assigning tableview footer data nil , crashes app.
Comments
Post a Comment