1

My Usecase:

For an automatic export running once in a while I build an HelperApp, while the configuration of still is made in the MainApp.

My Setup:

  • MainApp (writes data)
  • HelperApp (mostly reads data but also writes to very few fields)

  • both Apps share a single core data persistent store using the same myapp.storedata file in a Group Contrainer

  • both Apps observe NSManagedObjectContextDidSaveNotification tell each other through NSDistributedNotificationCenter when their context got saved
    • this works, so the other App knows when it should update it's persistent store / managed object context
  • both Apps are sandboxed

My Problem:

I can not pass NSManagedObjectContextDidSaveNotification to the other app through NSDistributedNotificationCenter

How can I either

  • Cause the core data stack of any app to reload it's data?

or

  • Merge changes from the other app so that MOC gets updated?
martn_st
  • 2,576
  • 1
  • 24
  • 30
  • Did you figure this out? I'm wondering EXACTLY the same thing. mergeChangesFromContextDidSaveNotification: isn't possible without a notification object, and it's not clear how to update from disk. – stevesliva Apr 02 '14 at 03:46
  • This indicates it's impossible: http://stackoverflow.com/questions/2054180/nsmanagedobjectcontext-and-nsarraycontroller-reset-refresh-problem – stevesliva Apr 02 '14 at 04:05
  • Hey, thanks for your comment. Unf. I did not came ton a solution. Since it was for a small side project, I did just not pursue it anymore so far. But finding a solution on this would enable me to continue and probably even finish developing my small app. So I am interested in our take on this. I might consider using NSCoding instead of Core Data. – martn_st Apr 11 '14 at 20:15

0 Answers0