【发布时间】:2015-01-29 17:58:04
【问题描述】:
我正在使用 Core Data + iCloud 并获得不少 NSPersistentStoreCoordinatorStoresWillChangeNotifications,其中新旧商店的 URL 是相同的。我只使用一台设备,并且在运行我的应用程序时会发生多次。
如果商店 URL 没有更改,并且设备是唯一将数据保存到商店的设备,为什么会发出这些通知?当新旧网址相同时,这些通知可以忽略吗?
这里是通知的 userInfo 字典的内容:
NSConcreteNotification 0x17a5f6b0 {name = NSPersistentStoreCoordinatorStoresWillChangeNotification; object = <NSPersistentStoreCoordinator: 0x167e05c0>; userInfo = {
NSPersistentStoreUbiquitousTransitionTypeKey = 4;
added = (
"<NSSQLCore: 0x1787bcf0> (URL: file:///var/mobile/Containers/Data/Application/8D9D2E83-DCD6-427B-BF5B-371D6DFD1999/Documents/CoreDataUbiquitySupport/mobile~38BB3D02-34D8-4E44-BCBE-B3ACC4FFA2DC/QatQiGameData3/8FD336B2-35D5-4D5F-8B06-415C7CA523CB/store/qatqi.sqlite)"
);
removed = (
"<NSSQLCore: 0x1787bcf0> (URL: file:///var/mobile/Containers/Data/Application/8D9D2E83-DCD6-427B-BF5B-371D6DFD1999/Documents/CoreDataUbiquitySupport/mobile~38BB3D02-34D8-4E44-BCBE-B3ACC4FFA2DC/QatQiGameData3/8FD336B2-35D5-4D5F-8B06-415C7CA523CB/store/qatqi.sqlite)"
);
}}
【问题讨论】:
标签: ios core-data icloud nspersistentstore