2014-10-08 63 views
0

我有一個視圖包含從我的CoreData加載一些信息。它一般工作,但有一段時間,應用程序崩潰與此錯誤。應用程序崩潰與NSInternalInconsistencyException

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<DocumentCollectionViewCell: 0x7fb3bd0201b0; baseClass = UICollectionViewCell; frame = (0 0; 107 147); clipsToBounds = YES; opaque = NO; layer = <CALayer: 0x7fb3bd01eb10>>: An -observeValueForKeyPath:ofObject:change:context: message was received but not handled. 
Key path: syncStatus 
Observed object: <Document: 0x7fb3bd124570> (entity: Document; id: 0xd000000000500006 <x-coredata://CC1300FC-9C3A-4E58-8CCE-3F90C1E64718/Document/p20> ; data: { 
    createdAt = nil; 
    deleted = 0; 
    event = "0xd000000000040008 <x-coredata://CC1300FC-9C3A-4E58-8CCE-3F90C1E64718/Note/p1>"; 
    localFilePath = "/Users/AliCheriaa/Library/Developer/CoreSimulator/Devices/CEBD0938-6989-4173-9E94-6676B0D45BB5/data/Applications/0D94B2FA-D71D-434F-9082-E26E2FBF0893/Documents/1D43AE28-E7DB-4828-8A98-DB7BF159C273/IMG"; 
    mimeType = "image/jpeg"; 
    syncProgress = 0; 
    syncStatus = 0; 
    user = "0xd000000000040004 <x-coredata://CC1300FC-9C3A-4E58-8CCE-3F90C1E64718/User/p1>"; 
    uuid = "1D43AE28-E7DB-4828-8A98-DB7BF159C273"; 
}) 
Change: { 
    kind = 1; 
    new = 0; 
} 

我真的不知道這是一個核心數據異常或UIViewCollection例外,我怎麼可能最終解決它。

此致敬禮。

回答

0

我會先嚐試從可能的錯誤中縮小它的範圍。 我的第一個建議是從單元中刪除類「DocumentCollectionViewCell」,看看是否仍然導致崩潰。 如果是這樣,那麼它與您的DocumentCollectionViewCell類相關,並且錯誤與單元的初始化相關的可能性更大。 如果它沒有,那麼它會進一步堆棧,並可能在您的CollectionView的委託中。

錯誤看起來像KVO失敗,所以也許考慮從DocumentCollectionViewCell和委託中刪除任何核心數據調用。

相關問題