NSKeyedArchiver

//NSDictionary * glossary=[NSDictionary dictionaryWithObjectsAndKeys:@"111111",@"222222",@"33333",@"44444", nil];

NSString* path=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES)[0]stringByAppendingPathComponent:@"glossary.a"];

//把数据压缩为二进制

//[NSKeyedArchiver archiveRootObject:glossary toFile:path];

//NSDictionary * dict= [NSKeyedUnarchiver unarchiveObjectWithFile:path];

你可能感兴趣的:(NSKeyedArchiver)