Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8390507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:00:33+00:00 2026-06-09T19:00:33+00:00

I have a universal app that displays buttons inside an actionsheet. UIActionSheet *actionSheet =

  • 0

I have a universal app that displays buttons inside an actionsheet.

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[dataObj.preferences objectForKey:@"appts_name"], @"Reserve", nil];
[actionSheet showInView:self.view];

On an iPad that automatically gets changed to a UIPopoverController. This displays and acts fine, however if I have the above popover being displayed and change orientation on the iPad then tap one of the buttons, it crashes in that buttons method where I am wanting to display another popover, saying that

-[UIPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:]: Popovers cannot be presented from a view which does not have a window.

If I do not rotate the iPad and just tap a button it executes the same code just fine.

UINavigationController *navBar = [[UINavigationController alloc] initWithRootViewController:addItemView];
popOver = [[UIPopoverController alloc] initWithContentViewController:navBar];
if (viewPopover) {
    if (self.view.window != nil) {
        CLS_LOG(@"Rect: %@ - View: %@", NSStringFromCGRect(rectPopover), viewPopover);
        [popOver presentPopoverFromRect:rectPopover inView:viewPopover permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    }
} else {
    // We should NEVER get here but just incase. I don't want the app to crash.
    CLS_LOG(@"No viewPopover or rectPopover - %@ - %@", viewPopover, NSStringFromCGRect(rectPopover));
}

Log from the CLS_LOG

-[AppointmentViewController showAppointmentAdd] line 148 $ Rect: {{341.333, 592}, {1, 1}} - View: <UIScrollView: 0xc8c5d40; frame = (1044 0; 768 872); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0xc8c7780>; contentOffset: {-0, 188}>

rectPopover and viewPopover are legit. Why is the popOver crashing saying it isn’t in a window, but only when I rotate the device?

EDIT:
I found out it is being caused because after orientation change, I am reloading the view to account for the new sizes. It seems this takes precedence in the window. It also only seems to affect the UIActionSheet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:00:35+00:00Added an answer on June 9, 2026 at 7:00 pm

    Have you tried tried redisplaying the popover after rotation?

    You know when the rotation is occurring (willRotateToInterfaceOrientation:), and then you can redisplay the popover controller according to it’s new anchor point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a universal iOS app with a custom view that has three buttons,
I have a iPhone/iPad app (universal binary) with a regular UIWebView that displays webpages
My situation is that I have a universal app that talks to an sql
I am writing my first universal app, I have converted my nibs so that
My dilemma - I have a universal app that holds a lot of images
I have a universal app built that runs and works perfectly on an iPad,
I have a Universal iOS app that has been in the App Store for
I have written a universal iOS-App that runs fine on my iPhone and iPad,
in my universal app, I have a UIControl View inside of a UIScrollView. On
I have written a universal app that's working fine on both iPhone (iPod Touch)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.