0
我已將iCloud支持添加到我的核心數據。當我向數據庫添加內容時,關閉應用程序並嘗試再次打開該應用程序不啓動,它掛在我的啓動屏幕上,並在控制檯中看到兩個信息。首先,它會嘗試連接到位於.../CoreDataUbiquitySupport/...和第二SQLite數據庫文件是該iOS 9:使用iCloud的核心數據:掛上addPersistentStoreWithType
CoreData: sql: pragma journal_mode=delete
我認爲它發生只在模擬器。
這是什麼意思?哪裏不對?
它掛在addPersistentStoreWithType功能,幾分鐘後功能與例外
Error adding persistent store to coordinator: Error Domain=NSCocoaErrorDomain Code=134090 "(null)" UserInfo={NSSQLiteErrorDomain=5, NSUnderlyingException=error during SQL execution : The database operation timed out after 240.00 seconds.
這裏返回的是我怎麼添加持久性存儲:
let options = [
NSInferMappingModelAutomaticallyOption: true,
NSMigratePersistentStoresAutomaticallyOption: true,
NSPersistentStoreUbiquitousContentNameKey: "AppCloudStore"
]
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
do {
self.store = try self.storeCoordinator.addPersistentStoreWithType(NSSQLiteStoreType,
configuration: nil,
URL: storeURL,
options: options)
self.initialized = true
} catch let error as NSError {
print(error)
}
})