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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:17:22+00:00 2026-05-27T14:17:22+00:00

I’m getting a weird zombie object issue when I’m trying to merge my changes

  • 0

I’m getting a weird zombie object issue when I’m trying to merge my changes from a background NSOperation:

(controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:]: message sent to deallocated instance) 

I have a ViewController that pushes other controllers on a navController stack in my AppDelegate in the didSelectRowForIndexPath like so:

ABCViewController *myVC = [[ABCViewController alloc] initWithNibName:@"ABCViewController" bundle:nil];

ABCEvent *selectedEvent = [_fetchedResultsController objectAtIndexPath:indexPath];
[myVC setManagedObjectContext:[self managedObjectContext]];
[myVC setTitle:@"Title"];
[myVC setEvent:selectedEvent];

ABCAppDelegate *appDelegate = (ABCAppDelegate *)[[UIApplication sharedApplication] delegate];
[[appDelegate navController] pushViewController:myVC animated:YES];
[myVC release];

Then in my ViewDidLoad for ABCViewContoller I’m creating an operation queue, and adding my background operation to it:

_operationQueue = [[NSOperationQueue alloc] init];

As well as hooking up a notification so I can merge the changes:

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(contextDidSave:)
                                             name:NSManagedObjectContextDidSaveNotification
                                           object:nil];

All standard stuff I believe. The issue is if I select the row in the main VC, then go back to it, and hit the row again, I get that: message sent to deallocated instance message. Now, if I turn off the notification for NSManagedObjectContextDidSaveNotification, then I don’t get the error, so that’s definitely the culprit. My dealloc in my second controller is like this:

- (void)dealloc
{
    [super dealloc];
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [_operationQueue release];
}

So I’m unhooking that class as an observer. In my mind it shouldn’t be trying to merge changes on any unallocated instances. I believe somehow though it’s trying to merge changes back in on the first instance of my controller when I touch the row again, even though I stopped subscribing to that notification.

I’m pretty stumped on this. Any help would be much appreciated.

  • 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-27T14:17:23+00:00Added an answer on May 27, 2026 at 2:17 pm

    Are you using a fetchedResultsControllerDelegate at all?

    If you are, make sure to also set that to nil when the view disappears or unloads, otherwise it will continue to receive messages about changes in your data, regardless of removing the observer.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string

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.