iPhone - 存储一系列字符串?

时间:2010-10-09 00:53:26

标签: iphone save

保存字符串数组的最简单有效的方法是什么? 将数组存储在 DISK

1 个答案:

答案 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];