How to make a .plist fileReport
I have an api inside are the city’s ID, I do not want to request data every time,I want to writeToFile as plist,but the first written is too slow and memory skyrocketing.
Is there any method I can use to make it into a plist as local file,so users do not have to write again
Plist file obtained in this way is no data on the xcode view, but in fact it has already been written, you can find data through code
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString *plistPath = [paths objectAtIndex:0]; NSMutableArray *marr = [NSMutableArray array]; NSString *filename=[plistPath stringByAppendingPathComponent:@"city.plist"]; NSLog(@"filename == %@",filename); [marr addObject:@"字符串"]; [marr writeToFile:filename atomically:YES];
solved 04 months 5 Answer 35 views 0