tabBarItem viewController wont call viewDidLoad or awakeFromNib
I have a viewController which is connected to a tabBarItem, and I have set it up correctly in the xib file and that the tabBar displays the correct viewController but for some reason the viewDidLoad method nor the awakeFromNib methods are called when the tabBarItem is selected and the view is displayed.
Why is开发者_如何转开发 this?
EDIT: Answer thanks to tato
Image of what should be done.
Set the Class in the Class identity to the class/viewController you want to load with that tabBArItem.
Select the tabBarItem you want to connect the viewController too and the select inspector to get to this image and set the class.
Check in the Xib (MainWindow.xib if you used the XCode template) that you have assigned your own view controller class to the corresponding item (its in the identity inspector, Class Identity, Class)
精彩评论