TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2017 |
Maintained by Hiroshi Hashiguchi.
Step 1 : Define subclass of LKCodingObject
#import "LKCodingObject.h"
@interface UserInfo : LKCodingObject
@property (strong, nonatomic) NSString* name;
@property (strong, nonatomic) NSString* email;
@end
Step 2 : Archive an instance of the class
UserInfo* userInfo = UserInfo.new;
userInfo.name = @"Hoge";
userInfo.email = @"[email protected]";
[NSKeyedArchiver archiveRootObject:userInfo toFile:@"user_info.dat"];
Step 3 : Unarchive from the file
UeserInfo* userInfo = [NSKeyedUnarchiver unarchiveObjectWithFile:@"user_info.dat"];
It is not necessary to implement NSCoding methods.
Hiroshi Hashiguchi, [email protected]
LKCodingObject is available under the MIT license. See the LICENSE file for more info.