When alloc a UIViewController with nib name, it does not load the view yet, so we need to call loadView to load its view.
Such as
_playStationController = [[PlayStationViewController alloc] initWithNibName:@"PlayStationViewController"
bundle:nil];
[_playStationController loadView];
Otherwise when access the IBOutlet in the view, it may returns nil
没有评论:
发表评论