0
votes

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

3
i think its not because your action sheet because i used same code and its working fine at my end.saadnib
i just paste the above code in my didFinishlaunching and it works for me but my window has a view in it , does you have a view in window?saadnib
didFinishLaunchingWithOptions or didFinishLaunchingAli
didFinishLaunchingWithOptionssaadnib
it raise teh error I mentioned aboveAli

3 Answers

0
votes

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

0
votes

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.

0
votes

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