我有一个UIViewController
within a UINavigationController
,我正在UIViewController
从一个 XIB 文件将一秒钟推到导航堆栈上。此 XIB 还包括UINavigationItem
用于第二个视图控制器的标题和按钮,但在加载 XIB 时会忽略这些。有任何想法吗?
这是我的代码(photoViewController 是第二个 viewController)
- (void) displayPhotoWithId:(int)photoId {
if (_photoViewController == nil) {
self.photoViewController = [[[PhotoViewController alloc] initWithNibName:@"PhotoView" bundle:[NSBundle mainBundle]] autorelease];
}
_photoViewController.photoId = photoId;
[self.navigationController pushViewController:_photoViewController animated:YES];
}