I'm currently writing a today extension for one of my applications. Inside the extension the user can set bookmarks for articles. I have a ViewController in the app which displays all of the bookmarks and is hooked up to a NSFetchedResultsController.
I want to achieve that if a user adds a bookmark via the widget it automatically pops up in the application. I tried [self.managedObjectContext reset]
and the NSManagedObjectContextDidChangeNotification
- both without luck. When i completely exit the app and reopen it again, the changes done by the widget are visibile but not if the app still runs in the background.
Any ideas?
To share data between an app and its extension you need to create an AppGroup. It's not difficult but it takes different steps:
-applicationDocumentsDirectory
method of core data boiler plate code to point to a shared containerOr you can share
NSUserDefaults
to save transitionary data between app and extension. Here a sample project and here a tutorial.