Using Core Data with watchOS 2.0

后端 未结 2 500
再見小時候
再見小時候 2020-12-05 09:48

I made an iOS/Apple Watch app with WatchKit 1.0 that uses a shared group container and a custom framework to access the same Core Data store. Now, in the transition guide fo

相关标签:
2条回答
  • 2020-12-05 10:35

    I recommend setting up sync using the user info background transfer to mirror each database operation in both directions (if required) after transferring the store on first run.

    The WWDC Session 713 - Introducing Watch Connectivity covers the mechanisms required. Nice API they've put together.

    0 讨论(0)
  • 2020-12-05 10:51

    Yes, you'll have to maintain two separate stores. If either side is a "read-only" client and the CoreData datastore is small and changes infrequently you could potentially use the transferFile WatchConnectivity API to transfer the whole store each time it changes.

    0 讨论(0)
提交回复
热议问题