用NSKeyedArchiver來深複製對象

‍‍        NSMutableString*s1=[NSMutableString stringWithString:@"a"];spa

        NSMutableString*s2=[NSMutableString stringWithString:@"b"];orm

        NSMutableString*s3=[NSMutableStringstringWithString:@"c"];ci

        NSMutableArray*array=[NSMutableArray arrayWithCapacity:5];string

        [array addObject:s1];it

        [array addObject:s2];table

        [array addObject:s3];margin

        

        NSData*data=[NSKeyedArchiver archivedDataWithRootObject:array];top

        NSMutableArray*array2=[NSKeyedUnarchiver          unarchiveObjectWithData:data];   tab

        NSLog(@"%@",array2);di

相關文章
相關標籤/搜索