soloSwift
soloSwift

Reputation: 13

NSInvalidArgumentException: -[MKMapItem encodeWithCoder:]: unrecognized selector sent to instance 0x17034bfd0

I got a crash report, which is about unrecognized selector sent to instance when saving MKMapItem into Data Store. According to MKMapItem documents(MKMapItem Document), it conforms to NSSecureCoding, which means that it should have no problem to save it into an NSManagedObject instance. it looks fine on ios 11 version, as i didn't receive crash report from the device with this version. Also, I walkthrough the feature that possibly saving MKMapItem on my phone. the context does save the NKMapItem into data store and the feature is working. Since my phone is running IOS 11, so I am thinking it could be about the version system??

Please correct me if misunderstand something.

Here is the crash report.

OS Version:          iPhone OS 10.3.3 (14G60)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x181646fe0 __exceptionPreprocess + 124 (NSException.m:165)
1   libobjc.A.dylib                 0x1800a8538 objc_exception_throw + 56 (objc-exception.mm:521)
2   CoreFoundation                  0x18164def4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 140 (NSObject.m:328)
3   CoreFoundation                  0x18164af54 ___forwarding___ + 916 (NSForwarding.m:3126)
4   CoreFoundation                  0x181546d4c _CF_forwarding_prep_0 + 92
5   Foundation                      0x18209afd4 _encodeObject + 1176 (NSKeyedArchiver.m:873)
6   Foundation                      0x1820a1e9c +[NSKeyedArchiver archivedDataWithRootObject:] + 168 (NSKeyedArchiver.m:421)
7   CoreData                        0x18391ae28 -[NSSQLiteConnection execute] + 1952 (NSSQLiteConnection.m:4165)
8   CoreData                        0x1839520e4 -[NSSQLiteConnection insertRow:] + 456 (NSSQLiteConnection.m:2966)
9   CoreData                        0x183ae3df8 _writeChangesForSaveRequest + 824 (NSSQLCore_Functions.m:1561)
10  CoreData                        0x183ae5584 _executeSaveChangesRequest + 388 (NSSQLCore_Functions.m:1622)
11  CoreData                        0x183adb5f0 -[NSSQLSaveChangesRequestContext executeRequestUsingConnection:] + 44 (NSSQLSaveChangesRequestContext.m:103)
12  CoreData                        0x1839f30c4 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 256 (NSSQLConnectionManager.m:305)
13  libdispatch.dylib               0x1804fe9a0 _dispatch_client_callout + 16 (object.m:473)
14  libdispatch.dylib               0x18050bee0 _dispatch_barrier_sync_f_invoke + 84 (queue.c:3446)
15  CoreData                        0x1839f2f64 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 208 (NSSQLConnectionManager.m:290)
16  CoreData                        0x183ab5824 -[NSSQLCoreDispatchManager routeStoreRequest:] + 272 (NSSQLCoreDispatchManager.m:56)
17  CoreData                        0x183a2075c -[NSSQLCore dispatchRequest:withRetries:] + 236 (NSSQLCore.m:2726)
18  CoreData                        0x183a1c578 -[NSSQLCore processSaveChanges:forContext:] + 200 (NSSQLCore.m:1569)
19  CoreData                        0x183920f10 -[NSSQLCore executeRequest:withContext:error:] + 724 (NSSQLCore.m:1923)
20  CoreData                        0x1839ff84c __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 3492 (NSPersistentStoreCoordinator.m:2820)
21  CoreData                        0x1839f80f0 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 276 (NSPersistentStoreCoordinator.m:586)
22  CoreData                        0x183920adc -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 408 (NSPersistentStoreCoordinator.m:2706)
23  CoreData                        0x18394197c -[NSManagedObjectContext save:] + 2548 (NSManagedObjectContext.m:1419)
24  myappName                       0x10009421c coreDataManager.saveContext() + 92 (coreDataManager.swift:514)
25  myappName                       0x1000b5970 closure #1 in eventUpdateManager.observeValue(forKeyPath:of:change:context:) + 64 (eventUpdateManager.swift:138)
26  myappName                       0x100124924 thunk for @escaping @callee_guaranteed () -> () + 36 (customAnimationController.swift:0)
27  libdispatch.dylib               0x1804fe9e0 _dispatch_call_block_and_release + 24 (init.c:963)
28  libdispatch.dylib               0x1804fe9a0 _dispatch_client_callout + 16 (object.m:473)
29  libdispatch.dylib               0x1805035e8 _dispatch_main_queue_callback_4CF + 996 (inline_internal.h:2431)
30  CoreFoundation                  0x1815f50c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
31  CoreFoundation                  0x1815f2ce4 __CFRunLoopRun + 1572 (CFRunLoop.c:3004)
32  CoreFoundation                  0x181522da4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
33  GraphicsServices                0x182f8d074 GSEventRunModal + 100 (GSEvent.c:2245)
34  UIKit                           0x1877ddc9c UIApplicationMain + 208 (UIApplication.m:4089)
35  myappName                       0x10005da1c main + 56 (receiptCollectionViewCell.swift:18)
36  libdyld.dylib                   0x18053159c start + 4

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000180641014 __pthread_kill + 8
1   libsystem_pthread.dylib         0x000000018070b264 pthread_kill + 112 (pthread.c:1366)
2   libsystem_c.dylib               0x00000001805b59c4 abort + 140 (abort.c:91)
3   myappName                       0x0000000100170ac8 uncaught_exception_handler + 72
4   CoreFoundation                  0x0000000181647354 __handleUncaughtException + 628 (NSException.m:218)
5   libobjc.A.dylib                 0x00000001800a8814 _objc_terminate() + 112 (objc-exception.mm:656)
6   myappName                       0x0000000100155408 MSCrashesUncaughtCXXTerminateHandler() + 732 (MSCrashesCXXExceptionHandler.mm:171)
7   libc++abi.dylib                 0x00000001800975d4 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:68)
8   libc++abi.dylib                 0x00000001800971a8 __cxa_rethrow + 144 (cxa_exception.cpp:584)
9   libobjc.A.dylib                 0x00000001800a86f8 objc_exception_rethrow + 44 (objc-exception.mm:559)
10  CoreData                        0x0000000183941cb0 -[NSManagedObjectContext save:] + 3368 (NSManagedObjectContext.m:1548)
11  myappName                       0x000000010009421c coreDataManager.saveContext() + 92 (coreDataManager.swift:514)
12  myappName                       0x00000001000b5970 closure #1 in eventUpdateManager.observeValue(forKeyPath:of:change:context:) + 64 (eventUpdateManager.swift:138)
13  myappName                       0x0000000100124924 thunk for @escaping @callee_guaranteed () -> () + 36 (customAnimationController.swift:0)
14  libdispatch.dylib               0x00000001804fe9e0 _dispatch_call_block_and_release + 24 (init.c:963)
15  libdispatch.dylib               0x00000001804fe9a0 _dispatch_client_callout + 16 (object.m:473)
16  libdispatch.dylib               0x00000001805035e8 _dispatch_main_queue_callback_4CF + 996 (inline_internal.h:2431)
17  CoreFoundation                  0x00000001815f50c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
18  CoreFoundation                  0x00000001815f2ce4 __CFRunLoopRun + 1572 (CFRunLoop.c:3004)
19  CoreFoundation                  0x0000000181522da4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
20  GraphicsServices                0x0000000182f8d074 GSEventRunModal + 100 (GSEvent.c:2245)
21  UIKit                           0x00000001877ddc9c UIApplicationMain + 208 (UIApplication.m:4089)
22  myappName                       0x000000010005da1c main + 56 (receiptCollectionViewCell.swift:18)
23  libdyld.dylib                   0x000000018053159c start + 4

Upvotes: 1

Views: 129

Answers (0)

Related Questions