NSKeyedArchiver : NSCoder
@interface NSData : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
@protocol NSCoding
- (void)encodeWithCoder:(NSCoder *)aCoder;
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder; // NS_DESIGNATED_INITIALIZER
@end
@implementation objectX
- (void)encodeWithCoder:(NSCoder *)aCoder
{
}
@end
objectX *ojx = [objectX new];
[NSKeyedArchiver archivedDataWithRootObject:ojx];
* thread #1: tid = 0x125a24, 0x000000010725ac3f nscodingX`-[objectX encodeWithCoder:](self=0x00007fe1abe53540, _cmd="encodeWithCoder:", aCoder=0x00007fe1abe46410) + 47 at objectX.m:16, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
* frame #0: 0x000000010725ac3f nscodingX`-[objectX encodeWithCoder:](self=0x00007fe1abe53540, _cmd="encodeWithCoder:", aCoder=0x00007fe1abe46410) + 47 at objectX.m:16
frame #1: 0x0000000107354d57 Foundation`_encodeObject + 1259
frame #2: 0x000000010735452e Foundation`+[NSKeyedArchiver archivedDataWithRootObject:] + 162
frame #3: 0x000000010725a89d nscodingX`-[ViewController viewDidLoad](self=0x00007fe1abe539b0, _cmd="viewDidLoad") + 125 at ViewController.m:24