This seems to happen when I am using a nib file to load the view . I need to set the datasources and delegates for some custom views progammatically . They work only if i set them in the viewDidLoad method . Setting them in the initializer , awakeFromNib etc all fail. Does anyone know the reason for this ?
Share
When you create a view controller from a nib file, the UIViewController is first initialized and then loaded. So when the
initWithNibName:bundle:method is calledself.viewand any other views loaded from the nib will benil. Also it may happen that the views are unloaded (seeviewDidUnload). That’s why any view-related initialization needs to happen inviewDidLoad.