Simperium未处理的例外情况

时间:2013-07-31 15:55:45

标签: objective-c xcode core-data simperium

我正在使用最新的Simperium库崩溃我的应用程序。据我所知,我已经设置了所有内容,但每当它开始尝试同步核心数据时,就会发生异常。

以下是抛出的异常:

2013-07-31 15:02:00:234 Twitter Translator[28336:303] Simperium enqueuing 168 object requests (Tweet)
2013-07-31 15:07:36.446 Twitter Translator[28336:303] -[AppDelegate handleManagedObjectContextChange:]: unrecognized selector sent to instance 0x102609120
2013-07-31 15:07:36.446 Twitter Translator[28336:303] An uncaught exception was raised
2013-07-31 15:07:36.446 Twitter Translator[28336:303] -[AppDelegate   handleManagedObjectContextChange:]: unrecognized selector sent to instance 0x102609120
2013-07-31 15:07:36.449 Twitter Translator[28336:303] (
0   CoreFoundation                      0x00007fff95799b06 __exceptionPreprocess + 198
1   libobjc.A.dylib                     0x00007fff897bb3f0 objc_exception_throw + 43
2   CoreFoundation                      0x00007fff9583040a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3   CoreFoundation                      0x00007fff9578802e ___forwarding___ + 414
4   CoreFoundation                      0x00007fff95787e18 _CF_forwarding_prep_0 + 232
5   CoreFoundation                      0x00007fff9574beda _CFXNotificationPost + 2554
6   Foundation                          0x00007fff8c7a27b6 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
7   CoreData                            0x00007fff93b1b46f -[NSManagedObjectContext _mergeChangesFromDidSaveDictionary:usingObjectIDs:] + 3263
8   Simperium-OSX                       0x00000001001b5251 __34-[SPCoreDataStorage mergeChanges:]_block_invoke + 49
9   libdispatch.dylib                   0x00007fff94d11a2d _dispatch_barrier_sync_f_slow_invoke + 77
10  libdispatch.dylib                   0x00007fff94d0c0b6 _dispatch_client_callout + 8
11  libdispatch.dylib                   0x00007fff94d110c8 _dispatch_main_queue_callback_4CF + 275
12  CoreFoundation                      0x00007fff9573bb4c __CFRunLoopRun + 1644
13  CoreFoundation                      0x00007fff9573b0e2 CFRunLoopRunSpecific + 290
14  HIToolbox                           0x00007fff95247eb4 RunCurrentEventLoopInMode + 209
15  HIToolbox                           0x00007fff95247b94 ReceiveNextEventCommon + 166
16  HIToolbox                           0x00007fff95247ae3 BlockUntilNextEventMatchingListInMode + 62
17  AppKit                              0x00007fff8cc0e533 _DPSNextEvent + 685
18  AppKit                              0x00007fff8cc0ddf2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
19  AppKit                              0x00007fff8cc051a3 -[NSApplication run] + 517
20  AppKit                              0x00007fff8cba9bd6 NSApplicationMain + 869
21  Twitter Translator                  0x0000000100005932 main + 34
22  libdyld.dylib                       0x00007fff8a7a37e1 start + 0
23  ???                                 0x0000000000000003 0x0 + 3
)
2013-07-31 15:07:36.449 Twitter Translator[28336:303] *** Terminating app due to uncaught exception      'NSInvalidArgumentException', reason: '-[AppDelegate handleManagedObjectContextChange:]: unrecognized selector     sent to instance 0x102609120'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff95799b06 __exceptionPreprocess + 198
1   libobjc.A.dylib                     0x00007fff897bb3f0 objc_exception_throw + 43
2   CoreFoundation                      0x00007fff9583040a -[NSObject(NSObject)     doesNotRecognizeSelector:] + 186
3   CoreFoundation                      0x00007fff9578802e ___forwarding___ + 414
4   CoreFoundation                      0x00007fff95787e18 _CF_forwarding_prep_0 + 232
5   CoreFoundation                      0x00007fff9574beda _CFXNotificationPost + 2554
6   Foundation                          0x00007fff8c7a27b6 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
7   CoreData                            0x00007fff93b1b46f -[NSManagedObjectContext _mergeChangesFromDidSaveDictionary:usingObjectIDs:] + 3263
8   Simperium-OSX                       0x00000001001b5251 __34-[SPCoreDataStorage mergeChanges:]_block_invoke + 49
9   libdispatch.dylib                   0x00007fff94d11a2d _dispatch_barrier_sync_f_slow_invoke + 77
10  libdispatch.dylib                   0x00007fff94d0c0b6 _dispatch_client_callout + 8
11  libdispatch.dylib                   0x00007fff94d110c8 _dispatch_main_queue_callback_4CF + 275
12  CoreFoundation                      0x00007fff9573bb4c __CFRunLoopRun + 1644
13  CoreFoundation                      0x00007fff9573b0e2 CFRunLoopRunSpecific + 290
14  HIToolbox                           0x00007fff95247eb4 RunCurrentEventLoopInMode + 209
15  HIToolbox                           0x00007fff95247b94 ReceiveNextEventCommon + 166
16  HIToolbox                           0x00007fff95247ae3 BlockUntilNextEventMatchingListInMode + 62
17  AppKit                              0x00007fff8cc0e533 _DPSNextEvent + 685
18  AppKit                              0x00007fff8cc0ddf2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
19  AppKit                              0x00007fff8cc051a3 -[NSApplication run] + 517
20  AppKit                              0x00007fff8cba9bd6 NSApplicationMain + 869
21  Twitter Translator                  0x0000000100005932 main + 34
22  libdyld.dylib                       0x00007fff8a7a37e1 start + 0
23  ???                                 0x0000000000000003 0x0 + 3
 )
libc++abi.dylib: terminate called throwing an exception

我认为发生错误的行是这一行:

     dispatch_sync(dispatch_get_main_queue(), ^{
    [__managedObjectContext mergeChangesFromContextDidSaveNotification:notification];
});

但我不是百分百肯定,因为我的虫子捕获不是那么好:(

有人有任何想法吗?

由于

加雷

1 个答案:

答案 0 :(得分:1)

这一行:

2013-07-31 15:07:36.446 Twitter Translator[28336:303] -[AppDelegate   handleManagedObjectContextChange:]: unrecognized selector sent to instance 0x102609120

告诉你需要知道的一切。您正在尝试将消息handleManagedObjectContextChange:发送给您的应用程序委托,但它没有实现该方法。所以你需要做的是确定发送消息的位置,并确认它确实被发送到你想要发送给它的对象。

我意识到这个答案可能有点笼统,但你只提供了一行代码,并没有告诉我们多少。从堆栈跟踪的外观中,确定处理通知的区域;这可能是一个开始寻找的好地方。