1
votes

In my universal iPhone/iPad app, I get a crash only on the iPad when I am trying to present an action sheet within a modal view. It doesn't crash when I am in the main view. The process goes something like:

(user clicks a button to present the modal view)

-(IBAction)showModal:(id)sender {
    modalController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:modalController animated:YES];
}

(then, at a specified time, a function is called which then brings up a UIActionSheet)

actionSheet = [[UIActionSheet alloc] initWithTitle:@"Alarm"
                                        delegate:self
                               cancelButtonTitle:nil
                          destructiveButtonTitle:@"Dismiss"
                                   otherButtonTitles:nil];
[actionSheet showInView:self.view];

This gives me the following error:

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

Does anyone have any idea why I am getting this error on just the iPad? Thanks!

1
self.view is nil. You should show us more code ... - zrzka
There is a lot of code I don't know what would be relevant to include? The thing is it works on the iPhone, just not the iPad. - user634944
Did you ever figure this out? The documentation suggests calling showFromRect:inView:animated: on an iPad but not that showInView: is unacceptable. developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/… - Brian White

1 Answers

0
votes

Shouldn't you be using?:

UIActionsheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Alarm"
                                    delegate:self
                           cancelButtonTitle:nil
                      destructiveButtonTitle:@"Dismiss"
                               otherButtonTitles:nil];

[actionSheet showInView:[self view]];