I am currently working on an app that is document based on both OS X and iOS and uses Core Data. To make the documents the same on the two platforms I am using BSManagedDocument on the OS X side.
If I launch the app on both platforms simultaneously and open the same document in each I can make changes on the OS X side and get two notifications on the iOS side (one when the document state goes to editing disabled and one when it returns to normal). I can easily use the second one as a trigger to update the UI allowing the iOS side to work as it should.
The problem is when I make a change on the iOS side. When this happens the document window gets re-opened (I've verified that windowControllerDidLoadNib:
is getting called). In a simple app this is mostly just a hiccup (though one that needs to be removed) while in more complex apps I have seen this result in only a partial redraw of the window contents.
I tried registering for NSPersistentStoreDidImportUbiquitousContentChangesNotification
but this notification never happens on either platform.
Is there any way at all on OS X to be informed that changes have come in from iCloud so that the required updates can be made to the UI and then prevent the re-opening of the window?