调用[NSManagedObject save]时保存异常

时间:2014-10-27 03:16:56

标签: ios core-data nsmanagedobject

当我调用[NSManagedObject save]方法时,我遇到了异常。 这是一个IM应用程序。应用程序同步历史消息时引发此异常。我有很多离线消息。我用来为每条消息打电话[NSManagedContext save]。我想这次崩溃的原因是保存方法调用的频率太快了。

回溯:

  Last Exception Backtrace:
0   CoreFoundation                  0x21f70c1f __exceptionPreprocess + 127
1   libobjc.A.dylib                 0x2f9e9c8b objc_exception_throw + 38
2   CoreData                        0x21d38b6b -[NSSQLCore recordChangeSnapshot:forObjectID:] + 206
3   CoreData                        0x21cac8f5 -[NSSQLCore prepareForSave:] + 656
4   CoreData                        0x21cabd6f -[NSSQLCore saveChanges:] + 626
5   CoreData                        0x21c7a93d -[NSSQLCore executeRequest:withContext:error:] + 736
6   CoreData                        0x21d275c5 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 3564
7   CoreData                        0x21d2e76b gutsOfBlockToNSPersistentStoreCoordinatorPerform + 262
8   libdispatch.dylib               0x2ff497a7 _dispatch_client_callout + 22
9   libdispatch.dylib               0x2ff50ac9 _dispatch_barrier_sync_f_invoke + 48
10  CoreData                        0x21d222a7 _perform + 134
11  CoreData                        0x21c7a517 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 314
12  CoreData                        0x21c9bf75 -[NSManagedObjectContext save:] + 856
13  MTMessage                       0x000a4111 __50-[XMPPMessageModule xmppStream:didReceiveMessage:]_block_invoke180 (XMPPMessage.m:227)
14  CoreData                        0x21cff74d developerSubmittedBlockToNSManagedObjectContextPerform + 180
15  libdispatch.dylib               0x2ff515b1 _dispatch_queue_drain + 952
16  libdispatch.dylib               0x2ff4bf85 _dispatch_queue_invoke + 84
17  libdispatch.dylib               0x2ff52b9b _dispatch_root_queue_drain + 338
18  libdispatch.dylib               0x2ff53cd7 _dispatch_worker_thread3 + 94
19  libsystem_pthread.dylib         0x300aae31 _pthread_wqthread + 668
20  libsystem_pthread.dylib         0x300aab84 start_wqthread + 8

0 个答案:

没有答案