Note that there are some explanatory texts on larger screens.

plurals
  1. POModal View Controllers appear behind Action Sheet
    primarykey
    data
    text
    <p>My modal view controllers are being shown behind my UIActionSheet, and my UIActionSheet is not getting dismissed. I am using:</p> <pre><code>[self presentModalViewController:composeTweetView animated:YES]; </code></pre> <p>To present my modal view controller. </p> <p>My action sheet is being shown from the tabBar:</p> <pre><code>[actionSheet showFromTabBar:self.parentViewController.tabBarController.tabBar]; </code></pre> <p>This code worked on iOS 4.0.</p> <pre><code>if (buttonIndex == 0) { if (self.isLoggedIn) { [FlurryAPI logEvent:@"ST_REPLY_CLICKED"]; composeTweetView.isDirectMessage = FALSE; [self presentModalViewController:composeTweetView animated:YES]; [composeTweetView release]; } else { LoginViewController* loginView = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil]; loginView.delegate = self; loginView.isPostingComment = TRUE; self.isReply = TRUE; [self presentModalViewController:loginView animated:YES]; [loginView release]; [composeTweetView release]; } } </code></pre> <p><strong>Summary:</strong></p> <p>I have a UIViewController that contains a UITabBar. I am presenting a UIActionSheet which has a few buttons that present a modal view controller. When the modal view controller is presented, the UIActionSheet should dismiss itself and the modal view should be on the top of the stack. The problem is, the UIActionSheet does not dismiss, and the modal view is loaded behind it. This problem did not occur up until iOS 4.2.1</p> <p><strong>Steps to Reproduce:</strong></p> <ol> <li>Create a TabBar project, setting your Base SDK to iOS 4.2.1</li> <li>Create a button or trigger to show a UIActionSheet</li> <li>Allow one of the buttons in the UIActionSheet to present a modal view controller using the syntax: <code>[actionSheet showFromTabBar:self.parentViewController.tabBarController.tabBar];</code></li> </ol> <p><strong>Expected Results:</strong></p> <pre><code>1. The UIActionSheet should dismiss itself, and the modal view should appear in front </code></pre> <p><strong>Actual Results:</strong></p> <pre><code>1. The UIActionSheet does not get dismissed and the modal view appears behind it. </code></pre> <p><strong>Regression:</strong></p> <pre><code>This problem was not apparent prior to iOS 4.2.1 </code></pre> <p><strong>Notes:</strong> I have tried other ways of displaying the UIActionSheet all of which don't work as intended:</p> <pre><code>//[actionSheet showInView:self.parentViewController.tabBarController.tabBar]; //[actionSheet showInView:[self.view window]]; //[actionSheet showInView:self.parentViewController.tabBarController.view]; //[actionSheet showInView:[UIApplication sharedApplication].keyWindow]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload