我遇到了一個神祕的核心數據崩潰,通過我的應用程序中的崩潰報告,我很難提出一個理論。沒有繁殖步驟,沒有明顯的原因,但它發生了幾千次。崩潰報告相當含糊,但似乎發生在NSManagedObject
通過屬性分配給另一個?任何理論將不勝感激。神祕的核心數據錯誤崩潰
*** Terminating app due to uncaught exception 'NSObjectInaccessibleException', reason: 'CoreData could not fulfill a fault for '0x1dc92160 <x-coredata://6903F7F9-C600-4A29-A538-B3337F1D0BED/Profile/p47854>''
Last Exception Backtrace:
1 CoreFoundation __exceptionPreprocess + 163
2 libobjc.A.dylib objc_exception_throw + 30
3 CoreData _PFFaultHandlerLookupRow + 1477
4 CoreData _PF_FulfillDeferredFault + 203
5 CoreData _PF_ManagedObject_WillChangeValueForKeywithSetMutation + 71
6 CoreData -[NSManagedObject willChangeValueForKey:withSetMutation:usingObjects:] + 84
7 CoreData -[NSManagedObject _includeObject:intoPropertyWithKey:andIndex:] + 690
8 CoreData -[NSManagedObject _maintainInverseRelationship:forProperty:oldDestination:newDestination:] + 444
9 CoreData -[NSManagedObject _didChangeValue:forRelationship:named:withInverse:] + 1290
10 CoreData -[NSManagedObjectContext observeValueForKeyPath:ofObject:change:context:] + 322
11 Foundation NSKeyValueNotifyObserver + 273
12 Foundation NSKeyValueDidChange + 335
13 Foundation -[NSObject didChangeValueForKey:] + 94
14 CoreData -[NSManagedObject didChangeValueForKey:] + 126
15 CoreData -[NSManagedObject _updateFromRefreshSnapshot:includingTransients:] + 614
16 CoreData -[NSManagedObjectContext _copyChildObject:toParentObject:fromChildContext:] + 96
17 CoreData -[NSManagedObjectContext _parentProcessSaveRequest:inContext:error:] + 554
18 CoreData __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke_0 + 565
19 libdispatch.dylib _dispatch_barrier_sync_f_slow_invoke + 81
20 libdispatch.dylib _dispatch_client_callout + 23
21 libdispatch.dylib _dispatch_main_queue_callback_4CF$VARIANT$up + 227
22 CoreFoundation __CFRunLoopRun + 1291
23 CoreFoundation CFRunLoopRunSpecific + 356
24 CoreFoundation CFRunLoopRunInMode + 104
25 GraphicsServices GSEventRunModal + 74
26 UIKit UIApplicationMain + 1120
27 My App main (main.m:18)
28 libdyld.dylib start + 0
在你的代碼中有沒有在不同線程之間共享NSManagedObjects的地方?例如,您在主線程上獲取對象,然後將其放入dispatch_async(background_queue ...)進行處理。或者,也許你訪問NSManagedObjectContext是從其他線程在主線程上創建的? –
據我所知,並沒有做很多工作來避免這種事情。 –
@MishaKarpenko可能是正確的道路。這聞起來像是一個線程問題。像這樣的錯誤錯誤通常在線程邊界被違反時發生。 –