My working solution used MMWormhole to send a notification ( NSManagedObjectContextDidSaveNotification ) from the iPhone app to my watch app. In the watch application controller, I used the mergeChangesFromContextDidSaveNotification: method for NSManagedObjectContext.
// in iPhone app notification handler MMWormhole *wormhole = [[MMWormhole alloc] initWithApplicationGroupIdentifier:@"your.group.container.identifier" optionalDirectory:nil]; [wormhole passMessageObject:notification identifier:@"your notification identifier"]; // in WKInterfaceController awakeWithContext: method MMWormhole *wormhole = [[MMWormhole alloc] initWithApplicationGroupIdentifier:@"your.group.container.identifier" optionalDirectory:nil]; [wormhole listenForMessageWithIdentifier:@"your notification identifier" listener:^(id messageObject) { [self.managedObjectContext mergeChangesFromContextDidSaveNotification:messageObject]; }];
Then NSFetchedResultsController did all the other work with UI updates.
You must implement the initWithCoder: and encodeWithCoder: methods from the NSCoding protocol for your NSManagedObject subclasses because MMWormhole uses NSKeyedArchiver as its serialization environment.
- (id)initWithCoder:(NSCoder *)decoder { NSManagedObjectContext *context = ...
source share