所以發生了什麼這裏是應用剛剛收到了NSPersistentStoreDidImportUbiquitousContentChangesNotification
,我剛纔叫有沒有人知道這是怎麼回事?核心數據/ iCloud的
- (void)storesDidUpdate:(NSNotification*)note {
FLOG(@"storesDidUpdate ");
[_managedObjectContext mergeChangesFromContextDidSaveNotification:note];
// Refresh user Interface
[[NSNotificationCenter defaultCenter] postNotificationName:@"iProjectCoreDataUpdated"
object:self];
[self updateDetails];
}
而現在的應用程序試圖通過簡單地做更新與文本的新副本一個UITextView以下內容:
self.detailText.attributedText = [self.detailItem valueForKey:@"scope"];
其中detailItem是在從iCloud接收更新之前檢索到的NSManagedObject。
不知道爲什麼textContainer在抱怨或者抱怨什麼,也不知道爲什麼導入日誌正在發生,因爲我已經收到一個通知,說它已經完成了!
奇怪的是,其他UITableViews更新正確,如果我只是調用reloadData。
有關我在這裏做錯事情的任何想法?請注意,如果我不嘗試更新textView,它會正常工作,如果我關閉視圖並返回它,那麼我會得到正確的數據。
此外,當我重新啓動應用程序時,所有數據都存在,沒有損壞或任何事情,事實上,儘管事情在iCloud的任何一方都爆炸,但應用程序在覈心數據存儲方面似乎非常健壯。
哦,reloadFetchedResults有點讓人誤解,因爲我似乎不需要這樣做,所以方法名稱是過去的宿醉,我所做的只是刷新UI調用中的值。
2013-10-09 07:25:53.783 MyApp[4509:510b] OpeningViewController.reloadFetchedResults: called 2013-10-09 07:25:53.786 MyApp[4509:510b] InfoDetailViewController.reloadFetchedResults: called in InfoDetailViewController 2013-10-09 07:25:53.788 MyApp[4509:510b] * Assertion failure in void _UIPerformResizeOfTextViewForTextContainer(NSLayoutManager *, UIView *, NSTextContainer *, NSUInteger)(), /SourceCache/UIFoundation/UIFoundation-258/UIFoundation/TextSystem/NSLayoutManager_Private.m:1510 2013-10-09 07:25:53.793 MyApp[4509:510b] -_PFUbiquityRecordImportOperation main: CoreData: Ubiquity: Error importing transaction log: transactionLogLocation: : /var/mobile/Library/Mobile Documents/HHHHHHNNNN~com~mycompany~MyApp/CoreData/New Document/duncangroenewald~simAABC628E-9D5E-58F7-9B8D-0BC724C6D0C8/New Document/W8MckEJ0x2d~HZZIeUH2be6hs41TEOONzKIrCuLcuP4=/6C953E7C-B2AF-47F7-B828-DD062B96415D.1.cdt transactionNumber: 5 , exception: Only run on the main thread! User Info: (null) 2013-10-09 07:25:53.803 MyApp[4509:510b] -_PFUbiquityRecordsImporter operation:failedWithError:: CoreData: Ubiquity: Import operation encountered an error: Error Domain=NSCocoaErrorDomain Code=134060 "The operation couldn’t be completed. (Cocoa error 134060.)" UserInfo=0x16d882c0 {exception=Only run on the main thread!} userInfo: { exception = "Only run on the main thread!"; }. While trying to import the log file at the URL: transactionLogLocation: : /var/mobile/Library/Mobile Documents/HHHHHHNNNN~com~mycompany~MyApp/CoreData/New Document/duncangroenewald~simAABC628E-9D5E-58F7-9B8D-0BC724C6D0C8/New Document/W8MckEJ0x2d~HZZIeUH2be6hs41TEOONzKIrCuLcuP4=/6C953E7C-B2AF-47F7-B828-DD062B96415D.1.cdt transactionNumber: 5 2013-10-09 07:25:53.809 MyApp[4509:510b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Only run on the main thread!' *** First throw call stack: (0x2ff23f53 0x3a6996af 0x2ff23e2d 0x308cb1df 0x3796643d 0x37966185 0x3798f7bb 0x379926f7 0x37992759 0x379b378b 0x379b331f 0x379b2f0d 0x3273b05d 0x129717 0x2fee6121 0x2fe5a317 0x3083edcd 0x308436ab 0x118263 0x2fee6121 0x2fe5a317 0x2fd8c69f 0x2fd8cc93 0x2fd813dd 0x3085197b 0x308f5b35 0x3ab83297 0x3ab8309b 0x3ab83d15 0x3ab83f8d 0x3acbedbf 0x3acbec84) libc++abi.dylib: terminating with uncaught exception of type NSException
編輯: 我已經發布了iOS和OSX一些樣本核心數據/ iCloud的應用程序在這裏 - 它們包括用於加載/後臺線程刪除數據,以及iCloud的同步。希望解決這裏描述的問題。 http://ossh.com.au/design-and-technology/software-development/sample-library-style-ios-core-data-app-with-icloud-integration/
在其他視圖奇怪的是,完全相同的代碼似乎更新用戶界面沒有任何問題。 –
很難確定,但錯誤信息反覆說'只在主線上運行!'這個事實可能是一個巨大的,巨大的,重要的線索,需要立即認真考慮。 –
Tom看到下面的附加信息... –