在我的通用iPhone / iPad应用程序中,当我尝试在模态视图中显示操作表时,我只在iPad上崩溃。当我在主视图中时它不会崩溃。这个过程类似于:
(用户点击按钮以显示模态视图)
-(IBAction)showModal:(id)sender {
modalController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:modalController animated:YES];
}
(然后,在指定的时间,调用一个函数,然后调出一个UIActionSheet)
actionSheet = [[UIActionSheet alloc] initWithTitle:@"Alarm"
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:@"Dismiss"
otherButtonTitles:nil];
[actionSheet showInView:self.view];
这给了我以下错误:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: view != nil'
有没有人知道我为什么只在iPad上收到此错误?谢谢!
答案 0 :(得分:0)
你不应该使用?:
UIActionsheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Alarm"
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:@"Dismiss"
otherButtonTitles:nil];
[actionSheet showInView:[self view]];