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

  • SEARCH
  • Home
  • 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 8623299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:14:55+00:00 2026-06-12T07:14:55+00:00

Possible Duplicate: UIPopovercontroller dealloc reached while popover is still visible Im creating a universal

  • 0

Possible Duplicate:
UIPopovercontroller dealloc reached while popover is still visible

Im creating a universal app and trying to get an image selected from Camera roll. Works fine on iPhone, iPad wants a pop over, so have done that, now keep getting an error

-[UIPopoverController dealloc] reached while popover is still visible.

Ive researched:

Stack Link

Stack Link

and google, nothing has solved this issue

Stuck now, any advice appreciated

Ive implemented the popover delegate in .h

.m

 - (void)logoButtonPressed:(id)sender /////////////iPad requires seperate method ////////////////
 {                                        

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {

LogCmd();
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
////////
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext;
////////
[self presentModalViewController:imagePicker animated:YES];


}

else

{

    // We are using an iPad
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.delegate = self;
    UIPopoverController *popoverController=[[UIPopoverController alloc] initWithContentViewController:imagePickerController];
    popoverController.delegate=self;


    [popoverController presentPopoverFromRect:((UIButton *)sender).bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];


   }


  }

I have also now tried this:

.h

 @property (strong) UIPopoverController *pop;

.m

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {            ///code added

LogCmd();
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
[self presentModalViewController:imagePicker animated:YES];


    ///code added////////////////////////////

}

else {

    if (self.pop) {
        [self.pop dismissPopoverAnimated:YES];
    }
    // If usingiPad
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];

    UIPopoverController *popoverController=[[UIPopoverController alloc] initWithContentViewController:imagePickerController];


    [popoverController presentPopoverFromRect:((UIButton *)sender).bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
  • 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-12T07:14:56+00:00Added an answer on June 12, 2026 at 7:14 am

    You instantiate the popover and assign it to a local variable here:

    UIPopoverController *popoverController=[[UIPopoverController alloc] initWithContentViewController:imagePickerController];
    

    As soon as the method returns, the variable goes out of scope and the object is deallocated since it has no owner anymore.

    What you should do is declare a strong property to assign the popover to. You have already done so with your pop property. So now all you need to do is at the time you allocate the popover, assign it to your property. This makes you the owner of the object so it won’t get deallocated.

    self.pop = [[UIPopoverController alloc] initWithContentViewController:imagePickerController];
    [self.pop presentPopoverFromRect:((UIButton *)sender).bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    

    Hope this helps!

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

Sidebar

Related Questions

Possible Duplicate: Trying to get tables next to each other horizontal I have two
Possible Duplicate: Sort JavaScript object by key I am creating JSONArray from JSONObject in
Possible Duplicate: Opening url in new tab while i am doing window.open(), my page
Possible Duplicate: Unable to get a list of installed Python modules How do I
Possible Duplicate: What is the fastest XML parser in PHP? I still need to
Possible Duplicate: Transparent images with C# WinForms I am coding an app which will
Possible Duplicate: Javascript window resize event I want to get an event which is
Possible Duplicate: PHP get all arguments as array? Within a javascript function arguments always
Possible Duplicate: nth-child for every two table rows I'm trying to work my way
Possible Duplicate: Get the size of a list in python? I need to be

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.