Unrecognized selector sent to instance while archiving data (NSCoding)

前端 未结 5 1898
名媛妹妹
名媛妹妹 2020-12-09 09:48
-(void)transformObjects:(NSMutableArray*)array key:(NSString*)key
{
    NSMutableArray* archiveArray = [[NSMutableArray alloc]initWithCapacity:array.count];

    for         


        
5条回答
  •  一整个雨季
    2020-12-09 10:36

    You have a custom class Furniture which you are trying to archive with NSKeyedArchiver. In order for this to work, the Furniture class needs to conform to the < NSCoding > protocol. Which means implementing the encodeWithCoder: and initWithCoder: methods.

    Currently you don't implement these methods. You need to add them.

提交回复
热议问题