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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:02:36+00:00 2026-05-22T13:02:36+00:00

I have a view controller that i’m trying to push onto the navigation stack.

  • 0

I have a view controller that i’m trying to push onto the navigation stack. I create the controller with a local variable, set it up, then assign it to a property. Then if I release the variable, I get EXE_BAD_ACCESS. if I retain (or auto release) it leaks.

CustomTVC* controller = [[CustomTVC alloc]initWithStyle:UITableViewStyleGrouped];
controller.managedObjectContext = self.managedObjectContext;

self.tableViewControllerIvar = controller;

[self.navigationController pushViewController:self.tableViewControllerIvar animated:YES];
 //[controller autorelease]; or [controller release]; or nothing

Here is exactly what happens if I release

  1. The above code is fired from pushing an add button in the nav bar.
  2. the view is pushed and everything is fine. In the new view I can push more views in over and over with no problem…unless
  3. I go back to the root view of the navigation stack. (Which is where the above code is from).
  4. Now if I drill down again to the second view, then try to push another it crashes.

Edit: I have a feeling that something is going wrong when I push the third controller onto the stack. With the push, it’s inserting a new object into the managed object context which is causing the fetchedresultscontroller to update the tableview. There may be a broken pointer in there somewhere. I’ll play with it and post the results. –

Edit: 5/16

Getting this error message in the log

* -[CustomTVC controllerWillChangeContent:]: message sent to deallocated instance 0x187270

This only happens after I pop the CustomTVC off the stack (go back to the navigation root view controller) I can push and save all I want as long as I don’t pop the CustomTVC.

  • 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-22T13:02:36+00:00Added an answer on May 22, 2026 at 1:02 pm

    Fixed it. Had to set the fetched results controllers delegate to nil in viewDidLoad.

    - (void)dealloc
    {
        self.fetchedResultsController.delegate = nil;
        [_fetchedResultsController release];
        [_managedObjectContext release];
        [super dealloc];
    }
    

    seems the culprit was(according to the zombie instruments):

    [NSFetchedResultsController(private methods) _managedObjectContextDidChange:]

    Edit(s): Finally took the time to figure out how to put code in here correctly (I’m lazy)

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

Sidebar

Related Questions

I have a view controller that allows users to add an nsstring to an
I have a view controller that gets presented modally and changes some data that
I have a view controller that can fetch many different types of entities from
i have a view controller that uses the getDistance method for calculating the distance
I have a view controller that's been added to a UITabBarController . In this
Hello I have a view controller that loads from an xib i created. It
I have an iPad app where I have a view controller that is the
I am working on an app where i have a view controller that contains
I have a class called Chair. I have a view controller that contains an
In a word, how? I have a view controller that creates a few custom

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.