
什么原因导致这个错误在哪里可以进一步了解这个错误?
[4972:2014294] CoreData: iCloud: Error: initial sync notification returned an error (Error Domain=BRCloudDocsErrorDomain Code=12 “The operation Couldn’t be completed. (BRCloudDocsErrorDomain error 12.)”)
[4972:2014294] -PFUbiquitySetupAssistant finishSetupWithRetry:: CoreData: Ubiquity: : retrying after delay: 60 Error Domain=BRCloudDocsErrorDomain Code=12 “The operation Couldn’t be completed. (BRCloudDocsErrorDomain error 12.)”
这里是一个代码段和更详细的日志来提供更多的上下文.
从应用程序委托:
- (voID)applicationDIDFinishLaunching:(UIApplication *)application { ... standard iCloud and app setup ... NSManagedobjectContext *context = [self managedobjectContext]; ... ... query the db ... } /** Returns the managed object context for the application. If the context doesn't already exist,it is created and bound to the persistent store coordinator for the application. */ - (NSManagedobjectContext *) managedobjectContext { if (managedobjectContext != nil) { return managedobjectContext; } NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; if (coordinator != nil) { managedobjectContext = [[NSManagedobjectContext alloc] init]; [managedobjectContext setPersistentStoreCoordinator: coordinator]; } managedobjectContext.mergePolicy = NSMergeByPropertyStoreTrumpMergePolicy; return managedobjectContext; } ... /** Returns the managed object model for the application. If the model doesn't already exist,it is created by merging all of the models found in the application bundle. */ - (NSManagedobjectModel *)managedobjectModel { if (managedobjectModel != nil) { return managedobjectModel; } managedobjectModel = [[NSManagedobjectModel mergedModelFromBundles:nil] retain]; return managedobjectModel; } ... /** Returns the persistent store coordinator for the application. If the coordinator doesn't already exist,it is created and the application's store added to it. */ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator != nil) { return persistentStoreCoordinator; } NSURL *storeUrl = [NSURL fileURLWithPath: [[NSSearchPathForDirectorIEsInDomains(NSdocumentDirectory,NSUserDomainMask,YES) lastObject] stringByAppendingPathComponent: @"myapp.sqlite"]]; NSLog(@"App Store URL : %@",storeUrl); NSError *error = nil; persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedobjectModel: [self managedobjectModel]]; NSDictionary *storeOptions; storeOptions = @{ NSMigratePersistentStoresautomaticallyOption : @YES,NSInferMapPingModelautomaticallyOption : @YES,NSPersistentStoreUbiquitousContentnameKey: @"AppCloudStore" }; #ifdef FREE storeOptions = @{ NSMigratePersistentStoresautomaticallyOption : @YES,NSPersistentStoreUbiquitousContentnameKey: @"FreeAppCloudStore" }; #endif // Register for Notifications NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addobserver:self selector:@selector(storesDIDChange:) name:NSPersistentStoreCoordinatorStoresDIDChangeNotification object:self.persistentStoreCoordinator]; [notificationCenter addobserver:self selector:@selector(persistentStoreDIDimportUbiquitousContentChanges:) name:NSPersistentStoreDIDimportUbiquitousContentChangesNotification object:self.persistentStoreCoordinator]; [notificationCenter addobserverForname:NSPersistentStoreCoordinatorStoresWillChangeNotification object:self.persistentStoreCoordinator queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { NSLog(@"Stores Will Change..."); if ([self.managedobjectContext hasChanges]) { NSError *saveError; if (![self.managedobjectContext save:&saveError]) { NSLog(@"Save error: %@",saveError); } } else { // drop any managed object references [self.managedobjectContext reset]; } }]; NSPersistentStore *store = [persistentStoreCoordinator addPersistentStoreWithType:NSsqliteStoreType configuration:nil URL:storeUrl options:storeOptions error:&error]; if (store == nil || error != nil) { NSLog(@"Error: %@,%@",error,[error userInfo]); abort(); } NSURL *finaliCloudURL = [store URL]; NSLog(@"Created persistent store okay. Final iCloud URL is: %@",finaliCloudURL); return persistentStoreCoordinator; } ... - (voID)persistentStoreDIDimportUbiquitousContentChanges:(NSNotification *)notification { NSLog(@"persistentStoreDIDimportUbiquitousContentChanges: Called. Content has changed via Core Data iCloud: *******************************************"); // Received and merge updates from iCloud [self.managedobjectContext mergeChangesFromContextDIDSaveNotification:notification]; [self notifyAndRefreshAllDataDuetoCloudEvent]; } ... - (voID)storesDIDChange:(NSNotification *)notification { // Tell me: why dID my stores changes? NSNumber *TransitionType = [notification.userInfo objectForKey:NSPersistentStoreUbiquitousTransitionTypeKey]; int theCause = [TransitionType intValue]; NSLog(@"storesDIDChange: NSPersistentStoreCoordinatorStoresDIDChange Notification = %@",notification); switch (theCause) { case NSPersistentStoreUbiquitousTransitionTypeAccountAdded: { NSLog(@"storesDIDChange: Account Added"); // account was added } break; case NSPersistentStoreUbiquitousTransitionTypeAccountRemoved: { NSLog(@"storesDIDChange: Account Removed"); // account was removed } break; case NSPersistentStoreUbiquitousTransitionTypeContentRemoved: { NSLog(@"storesDIDChange: Content Removed"); // content was removed } break; case NSPersistentStoreUbiquitousTransitionTypeInitialimportCompleted: { NSLog(@"storesDIDChange: Initial import:"); // initial import } break; default: break; } ... [[NSNotificationCenter defaultCenter] postNotificationname:@"*****DIDChangeByPersistentStoreChangesNotification" object:self]; [[NSNotificationCenter defaultCenter] postNotificationname:@"*****DIDChangeByPersistentStoreChangesNotification" object:self]; [[NSNotificationCenter defaultCenter] postNotificationname:@"*****DIDChangeByPersistentStoreChangesNotification" object:self]; } 更详细的日志:
2015-05-12 10:22:23.367 [4972:2014228] storesDIDChange: NSPersistentStoreCoordinatorStoresDIDChange Notification = NSConcreteNotification 0x17005f470 {name = NSPersistentStoreCoordinatorStoresDIDChangeNotification; object = <NSPersistentStoreCoordinator: 0x170072100>; userInfo = { added = ( "<NSsqlCore: 0x12dd100b0> (URL: file:///var/mobile/Containers/Data/Application/****/documents/CoreDataUbiquitySupport/mobile~****-7B78C4F2fdb2/FreeAppCloudStore/2***/store/app.sqlite)" );}}2015-05-12 10:22:23.409 [4972:2014228] -[PFUbiquitySwitchboardEntryMetadata setUselocalstorage:](808): CoreData: Ubiquity: mobile~****:FreeAppCloudStoreUsing local storage: 12015-05-12 10:22:23.410 [4972:2014228] Created persistent store okay. Final iCloud URL is: file:///var/mobile/Containers/Data/Application/****/store/app.sqlite2015-05-12 10:22:23.477 [4972:2014228] ApptableVIEwController:vIEwWillAppear: enter2015-05-12 10:22:23.478 [4972:2014228] getSharedAdBannerVIEw: enter2015-05-12 10:22:23.518 [4972:2014228] queryDIDUpdate: MSMetadataquery Notification: - NSMetadataqueryDIDFinishGatheringNotification2015-05-12 10:22:23.519 [4972:2014228] queryDIDUpdate: NSMetadataquery returned 25 results2015-05-12 10:22:23.524 [4972:2014228] setProcesstimer: 15.0000002015-05-12 10:22:23.531 [4972:2014228] tableVIEwController:vIEwDIDAppear: enter2015-05-12 10:22:23.531 [4972:2014228] tableVIEwController:loadData (or reload): enter2015-05-12 10:22:23.582 [4972:2014294] CoreData: iCloud: Error: initial sync notification returned an error (Error Domain=BRCloudDocsErrorDomain Code=12 "The operation Couldn't be completed. (BRCloudDocsErrorDomain error 12.)")2015-05-12 10:22:23.594 [4972:2014294] -[PFUbiquitySetupAssistant finishSetupWithRetry:](826): CoreData: Ubiquity: <PFUbiquitySetupAssistant: 0x12de18940>: retrying after delay: 60Error Domain=BRCloudDocsErrorDomain Code=12 "The operation Couldn't be completed. (BRCloudDocsErrorDomain error 12.)"2015-05-12 10:22:23.854 [4972:2014228] dIDFailToReceiveADWithError2015-05-12 10:22:55.150 [4972:2014228] bannerVIEwDIDLoadAd2015-05-12 10:23:24.178 [4972:2014228] queryDIDUpdate: MSMetadataquery Notification: - NSMetadataqueryDIDUpdateNotification2015-05-12 10:23:24.178 [4972:2014228] queryDIDUpdate: NSMetadataquery returned 25 results2015-05-12 10:23:25.039 [4972:2014228] Stores Will Change...2015-05-12 10:23:25.101 [4972:2014228] storesDIDChange: NSPersistentStoreCoordinatorStoresDIDChange Notification = NSConcreteNotification 0x170254940 {name = NSPersistentStoreCoordinatorStoresDIDChangeNotification; object = <NSPersistentStoreCoordinator: 0x170072100>; userInfo = { NSPersistentStoreUbiquitousTransitionTypeKey = 4; added = ( "<NSsqlCore: 0x12dd100b0> (URL: file:///var/mobile/Containers/Data/Application/****/FreeAppCloudStore/20EF5D1C-4748-4AB2-BCE1-91B228437D77/store/app.sqlite)" ); removed = ( "<NSsqlCore: 0x12dd100b0> (URL: file:///var/mobile/Containers/Data/Application/*****/store/app.sqlite)" );}}2015-05-12 10:23:25.101 [4972:2014646] -[PFUbiquitySwitchboardEntryMetadata setUselocalstorage:](808): CoreData: Ubiquity: mobile~*****FreeAppCloudStoreUsing local storage: 0解决方法 我希望我的答案可以为那些遇到这个错误的人节省很多时间. 当应用程序的删除和安装之间的时间小于一定间隔时,会发生此错误.我不知道是否和我一样,我的是15秒.
愚蠢的错误,浪费了几个小时.
总结以上是内存溢出为你收集整理的什么原因导致iOS iCloud错误:错误域= BRCloudDocsErrorDomain代码= 12“ *** 作无法完成.”延迟后重试:60全部内容,希望文章能够帮你解决什么原因导致iOS iCloud错误:错误域= BRCloudDocsErrorDomain代码= 12“ *** 作无法完成.”延迟后重试:60所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)