文件名称:本地存储NSUserdefault封装(可存储各种类型)
文件大小:17KB
文件格式:ZIP
更新时间:2019-01-14 05:05:09
本地存储
本地存储NSUserdefault封装(可存储各种类型),简单易用。 调用方法: #import "ViewController.h" #import "StudentModel.h" #import "InfoModel.h" #import "NSObject+JKLocalStore.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; StudentModel *student = [[StudentModel alloc] init]; student.name = @"A"; NSArray *array = @[[InfoModel new], [InfoModel new], [InfoModel new]]; student.datas = array; [student localStoreWithKey:@"FastCoding"]; StudentModel *tmpStudent = [StudentModel valueWithKey:@"FastCoding"]; NSLog(@"%@", tmpStudent.name); NSLog(@"%@", tmpStudent.datas); }
【文件预览】:
JKLocalStore
----FastCoder.h(2KB)
----NSObject+JKLocalStore.h(323B)
----JKLocalStore.h(360B)
----NSObject+JKLocalStore.m(438B)
----FastCoder.m(80KB)
----JKLocalStore.m(811B)