【发布时间】:2012-03-03 04:36:53
【问题描述】:
如果按下 UIALertView 按钮,我想打开一个 UIViewController。
我有那个代码。但是,没有打开 uiviewcontroller :(
我确信 uialertview 工作正常。 uiviewcontroller 的代码也很好。 (从其他地方调用时有效)。
有什么帮助吗?
谢谢。
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0) //Yes, Sign Me Up!
{
NSLog(@"0");
ViewerWebController *web = [[ViewerWebController alloc] initWithURL:[NSURL URLWithString:@"http://www.funimation.com/"]];
[web setShowToolbar:YES];
[self.navigationController pushViewController:web animated:YES];
[web release];
}
else if (buttonIndex == 1) //Remove from List
{
NSLog(@"1");
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"subscribeButtonOption"];
[_tableView reloadData];
}
else if (buttonIndex == 2) //"Maybe Later"
{
NSLog(@"2");
}
}
【问题讨论】:
-
显然某些部分无法正常工作:) 请发布代码。
-
您是将视图控制器推到导航控制器上还是模态显示视图控制器?
-
你用什么来“打开” UIViewController?不看一些代码 sn-ps 很难说哪里出了问题。
-
你能检查一下导航控制器是否在你尝试推送的时候初始化了吗? NSLog(@"%@",self.navigationController);
标签: objective-c ios uiviewcontroller uiwebview uialertview