drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 131 forks source link

FilePresenter should be removed when app enters background #231

Open pronebird opened 8 years ago

pronebird commented 8 years ago

Hi,

There is an interesting note in iOS documentation regarding File Presenters on iOS:

https://developer.apple.com/reference/foundation/nsfilecoordinator?language=objc

Excerpt:

File Presenters and iOS If your app enters the background with an active file presenter, any other processes that perform a coordinated read or write on the presented file can deadlock. To prevent this situation, call removeFilePresenter: to remove the file presenter in the applicationDidEnterBackground: method or in response to a UIApplicationDidEnterBackgroundNotification notification. Call addFilePresenter: to add the file presenter again in the applicationWillEnterForeground: method or in response to a UIApplicationWillEnterForegroundNotification notification.

Looking at CDEICloudFileSystem I don't see it following the suggestion from documentation. Is it some legacy notice or is this information still relevant to the latest iOS?

drewmccormack commented 8 years ago

Indeed. Looks like that is something we should change. Will look into it.