我试图从另一个视图控制器加载一个临时的幻灯片视图。我的应用程序的视图控制器结构:使用'presentModalViewController'加载视图
Application > Tab Bar Controller > TabBarItem > View Controller
在这个视图控制器,我有一个按钮,成功触发一个方法来加载临时视图:
- (IBAction)displayTimePickerViewForDayButton:(id)sender {
NSLog(@"displayTimePickerViewForDayButton method entered.");
// create the selector view controller and become the delegate
WOTimePickerViewController *tpvc = [[WOTimePickerViewController alloc] initWithNibName:@"WOTimePickerView" bundle:nil];
tpvc.delegate = self;
tpvc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:tpvc animated:YES];
[tpvc release];
}
我已经验证了我的WOTimePickerViewController成功返回从init方法,但视图永远不会输入它的viewDidLoad方法。
所以,如果我看看IB的视图,它似乎连接到vc的“视图”属性。当我在模拟器(从IB)中运行视图时,它可以正确渲染。
当我从XCODE运行应用程序时,我可以导航到视图,单击我的按钮,并出现一个空白的白色屏幕(注意,这不是应加载的视图的白色背景)。
建设的问题?也许你可以尝试删除项目目录中的'build'目录,然后再使用Xcode进行编译。所有的资源应该在那时正确地更新。 – Joost 2009-11-29 10:08:26