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() 

enter image description here

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

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -