缓存cahche
存入
在网络请求函数中写:
1 | NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dataarray]; |
取出
1 | NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:API_TOPIC_RCMD_GETRCMD]; |
Stay Hungry! Stay Foolish!
在网络请求函数中写:
1 | NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dataarray]; |
1 | NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:API_TOPIC_RCMD_GETRCMD]; |