So I'm used to iOS development so I'm pretty happy with NSFetchedResultsController. However, this is not present in the Mac OS X environment. I know that I can use NSArrayController as a replacement. I might be using this class terribly wrong but it worked until now. I initialize the NSArrayController as follows:
NSArrayController* newConversationsController = [NSArrayController new];
newConversationsController.managedObjectContext = context;
newConversationsController.entityName = entityName;
newConversationsController.sortDescriptors = sortDescriptors;
newConversationsController.automaticallyRearrangesObjects = YES;
NSError* error = nil;
[newConversationsController fetchWithRequest:nil merge:NO error:&error];
NSCAssert(!error, error.description);
Then I listen to changes of the NSManagedObjectContext and fetch and reload the NSTableView as follows:
[self.conversationsController fetchWithRequest:nil merge:YES error:&error];
NSAssert(!error, error.description);
[self.tableView reloadData];
As I previously mentioned, I might be using this totally wrong but I don't like to use bindings. Now to the actual issue: Another class of the application might delete an NSManagedObject held by the NSArrayController. The NSArrayController instantly releases this deleted object and makes it impossible for me to figure out which object that was. The final goal is to know what object at what index has been deleted so I can animate the rows of the NSTableView.
I hope it's clear what I'm aiming at. Thanks for any help