开发者

UIActionSheet at appdelegate

I want to display a UIActionSheet at the beginning of my application so I descided to fire it in my appdelegate class , at didFinishLaunchingWithOptions

using

UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Do you wish to install test cases " delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:nil otherButtonTitles: @"Yes", @"No", nil];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:window];
[popupQuery release];

but it 开发者_开发问答fire exception

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: view != nil'

how to fix that

best regards


You should show it inside view, not inside window! It seems that there is no any view on your window.


it will exactly works in my app.so NSInternalInconsistencyException means u would be so fast to click on various app like IB and Xcode and while running u would be tried to save file.so that causes inconsistency.just close and then open it will works.

check window outlet is connected or not in IB and also delegate.


[popupQuery showFromRect:self.window.frame inView:self.window animated:YES];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜