保存字符串数组的最简单有效的方法是什么? 将数组存储在 DISK
中答案 0 :(得分:3)
NSMutableArray *myMutableArray = [[NSMutableArray alloc] initWithCapacity:100];
int x = 0;
for(x=0; x<100;x++) {
[myMutableArray insertObject: [NSString stringWithFormat:@"This is NSString number %d!",x+1] atIndex:x];
}
[myMutableArray writeToFile:filePath atomically:YES];