CRASH NSCoder encodeObject

Hello, I'm getting this error randomly when I try to use NSCoder to encode an Array of NSDictionary containing decoded JSON from an API call. Any idea of what can cause this crash? Thanks


Crashed: NSOperationQueue 0x2826549c0 (QOS: UNSPECIFIED)
0  libobjc.A.dylib                0x1a39f5430 objc_retain + 16
1  CoreFoundation                 0x1a4839888 __CFBasicHashAddValue + 1480
2  CoreFoundation                 0x1a476a4ac CFDictionarySetValue + 260
3  Foundation                     0x1a5288888 _encodeObject + 732
4  VVIVizioAPI                    0x104e884b0 -[DataCore encodeWithCoder:] + 380
5  VVIVizioAPI                    0x104e649c4 -[DataHandle encodeWithCoder:] + 76
6  Foundation                     0x1a5288aa8 _encodeObject + 1276
7  Foundation                     0x1a51edc6c +[NSKeyedArchiver archivedDataWithRootObject:] + 168
8  VVIVizioAPI                    0x104e5ca34 __77+[CachableObject addObjectToCache:withCacheName:withTTL:withCompletionBlock:]_block_invoke + 300
9  Foundation                     0x1a529d8bc __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
10 Foundation                     0x1a51a5ab8 -[NSBlockOperation main] + 72
11 Foundation                     0x1a51a4f8c -[__NSOperationInternal _start:] + 740
12 Foundation                     0x1a529f790 __NSOQSchedule_f + 272
13 libdispatch.dylib              0x1a42456c8 _dispatch_call_block_and_release + 24
14 libdispatch.dylib              0x1a4246484 _dispatch_client_callout + 16
15 libdispatch.dylib              0x1a421ce04 _dispatch_continuation_pop$VARIANT$armv81 + 404
16 libdispatch.dylib              0x1a421c4e8 _dispatch_async_redirect_invoke + 592
17 libdispatch.dylib              0x1a4228aec _dispatch_root_queue_drain + 344
18 libdispatch.dylib              0x1a422934c _dispatch_worker_thread2 + 116
19 libsystem_pthread.dylib        0x1a442917c _pthread_wqthread + 472
20 libsystem_pthread.dylib        0x1a442bcec start_wqthread + 4

Replies

Crashes in

objc_retain
are almost always related to memory management problems, which you can investigate with the standard memory debugging tools.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"