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

------------------越是喧嚣的世界,越需要宁静的思考------------------ 合抱之木,生于毫末;九层之台,起于垒土;千里之行,始于足下。 积土成山,风雨兴焉;积水成渊,蛟龙生焉;积善成德,而神明自得,圣心备焉。故不积跬步,无以至千里;不积小流,无以成江海。骐骥一跃,不能十步;驽马十驾,功在不舍。锲而舍之,朽木不折;锲而不舍,金石可镂。蚓无爪牙之利,筋骨之强,上食埃土,下饮黄泉,用心一也。蟹六跪而二螯,非蛇鳝之穴无可寄托者,用心躁也。