nicklockwood / AutoCoding

AutoCoding is a category on NSObject that provides automatic support for NSCoding and NSCopying to every object.
Other
1.07k stars 131 forks source link

prevent encode & decode NSTimer object #33

Closed tzuyangliu closed 6 years ago

tzuyangliu commented 6 years ago

NSTimer does not comfirm to NSCoding protocol, encode & decode its instance can lead to a wired crash on iOS9 device, can we ignore NSTimer in codableProperties?

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   CoreFoundation                  0x224fc3f4 CFBasicHashFindBucket + 1656
1   CoreFoundation                  0x22520b16 CFDictionaryGetValueIfPresent + 122
2   Foundation                      0x22d9fb76 _decodeObjectBinary + 2986
3   Foundation                      0x22d9ef24 _decodeObject + 276
4   Foundation                      0x22da1886 -[NSKeyedUnarchiver decodeObjectOfClasses:forKey:] + 210
5   Foundation                      0x22da173c -[NSKeyedUnarchiver decodeObjectOfClass:forKey:] + 136
6   QQMusic                         0x0333c6a2 -[NSObject(AutoCoding) setWithCoder:] + 53708450 (AutoCoding.m:0)
7   QQMusic                         0x0333ca70 -[NSObject(AutoCoding) initWithCoder:] + 53709424 (AutoCoding.m:264)
8   Foundation                      0x22d9fae8 _decodeObjectBinary + 2844
9   Foundation                      0x22d9ef24 _decodeObject + 276
10  Foundation                      0x22df765a +[NSKeyedUnarchiver unarchiveObjectWithFile:] + 154
11  ...
nicklockwood commented 6 years ago

@tzuyangliu why did you close the issue - did the problem resolve itself?