ArchiverEasy 1.0

ArchiverEasy 1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2017

Maintained by Silence0201.



  • By
  • Silence

更简单的使用NSKeyedUnarchiverNSKeyedArchiver

使用

import

ArchiverEasy文件夹拉入目录 导入文件

#import "NSKeyedArchiver+Key.h"
#import "NSKeyedUnarchiver+Key.h"

Archiving

 // 默认存入沙盒Document/DefaultArchive文件夹中
[NSKeyedArchiver archiveRootObject:array forKey:@"kk"] ;

// 自定义文件夹路径
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"custom"] ;
[NSKeyedArchiver archiveRootObject:array forKey:@"kk" WithFolderPath:path] ;

Unarchiving

 // 从默认目录读取
NSArray *a1 = [NSKeyedUnarchiver unarchiveObjectForKey:@"kk"] ;

// 从指定目的读取
NSArray *a2 = [NSKeyedUnarchiver unarchiveObjectForKey:@"kk" WithPath:path] ;

ArchiverEasy

LKArchiver is available under the MIT license. See the LICENSE file for more info.