WatchKit 2.0 和 iPhone 共享核心数据

WatchKit 2.0 and iPhone shared coredata

大家。

我已经开始使用 Watch Kit 应用程序。使用 WatchKit 1 可以很容易地访问共享文件夹中的 coredata 数据库。但是当我更新到 xcode 7, watch kit 2.0 和 swift 2.0 时,AppleWatch 和 iPhone 似乎有不同的应用程序组共享文件夹地址。和下面的代码

NSURL *storeURL = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:BMCoreDataConstants.groupIdentifier];
storeURL = [storeURL URLByAppendingPathComponent:BMCoreDataConstants.sqliteStoreNameWithExtension];
在 iPhone 和 AppleWatch 上

Returns 不同 url。

如果您知道现在从父应用程序的核心数据中获取数据的最佳方式是什么,请告知?

我在此处找到了对 WWDC 视频的完美解释:

https://developer.apple.com/videos/wwdc/2015/?id=713

如有相同问题欢迎随时查看