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 6834007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:03:28+00:00 2026-05-26T23:03:28+00:00

I am getting a crash when I popToRootViewController , this is the way I

  • 0

I am getting a crash when I popToRootViewController, this is the way I have it set up.

I have:

@property (nonatomic, retain) UIPopoverController *popover;

in dealloc:

[popover release];

when a button is pressed

if (self.popover == nil) {
    DetailViewController *detailView = [[[DetailViewController alloc] init] autorelease];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(GoToTest:) name:TestDetailPressed object:detailView];
    self.popover = [[[UIPopoverController alloc] initWithContentViewController:detailView] autorelease];
    self.popover.delegate = self;
    [self.popover presentPopoverFromRect:frame inView:self.scrollView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}

My DetailViewController is essentially just a UITableView. When a row is selected, I post a notification back to this current class for GoToTest:

- (void)GoToTest:(NSNotification *)notification {
    if ([self.popover isPopoverVisible]) {
        [self.popover dismisspopoverAnimated:YES];
        [self handleDismissedPopover:self.popover];
    }
    [self.navigationController popToRootViewControllerAnimated:NO];
}

- (void)handleDismissedPopover:(UIPopoverController *)popoverController {
    self.popover = nil;
    self.popover.delegate = nil;
    [[NSNotificationCenter defaultCenter] removeObserver:self name:TestDetailPressed object:nil];
}

- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController {
    [self handleDismissedPopover:popoverController;
}

When I run it in Instruments, I get the zombie message for

 -[UIPopoverController _popoverDismissAnimationCompleted]

and the UIViewController has a refCt of -1 at that point.

  • 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-05-26T23:03:29+00:00Added an answer on May 26, 2026 at 11:03 pm

    You probably want to change self.popover = nill to popover = nil because the first (self.popover = nil) will call the property setter, which releases the old value and sets the member to nil. Also, put the delegate nil before the property nil.

    To fix, change this:

    - (void)handleDismissedPopover:(UIPopoverController *)popoverController {
        self.popover = nil;
        self.popover.delegate = nil;
        [[NSNotificationCenter defaultCenter] removeObserver:self name:TestDetailPressed object:nil];
    }
    

    To:

    - (void)handleDismissedPopover:(UIPopoverController *)popoverController {
        popover.delegate = nil;
        popover = nil;
        [[NSNotificationCenter defaultCenter] removeObserver:self name:TestDetailPressed object:nil];
    }
    

    And if that doesn’t work, set NSZombieEnabled, MallocStackLogging, and guard malloc in the debugger. Then, when your App crashes, type this in the gdb console:

    (gdb) info malloc-history 0x543216
    

    Replace 0x543216 with the address of the object that caused the crash, and you will get a much more useful stack trace and it should help you pinpoint the exact line in your code that is causing the problem.

    See this article for more detailed instructions.

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

Sidebar

Related Questions

I am getting a crash at line [selectedSession release]; in dealloc: Default [NSCheapMutableString release]:
In my application i am getting random crash at any location, i have used
I'm getting a crash from this routine after adding the :(id)sender so I could
I am getting this crash in the console: 2011-08-27 23:26:45.041 App[1672:3117] *** Terminating app
I am trying to set a property of tab(0) at tab(1). This is what
I'm getting this crash when selecting a row: '-[__NSCFArray objectAtIndex:]: index (1) beyond bounds
I'm getting a crash with this error message: 2012-01-14 15:09:36.667 [8274:15203] *** -[ExerciseHistoryDetailViewController controllerWillChangeContent:]:
XCode 3.1.2 using built-in OCTest unit testing. I'm getting a crash when unit tests
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/

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.