NSKeyedAchiver-归档NSArray

 

•归档一个NSArray对象到Documents/array.archive

NSArray *array = [NSArray arrayWithObjects:@”a”,@”b”,nil];

[NSKeyedArchiver archiveRootObject:array toFile:path];

•恢复(解码)NSArray对象

NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithFile:path];

posted @ 2014-06-03 16:57  Shdow_Walker  阅读(182)  评论(0编辑  收藏  举报