我需要将单独的行放入文件中,但似乎不受支持
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
// the path to write file
NSString *appFile = [documentsDirectory stringByAppendingPathComponent:@"myFile"];
[dataString writeToFile:appFile atomically:YES];
它确实将一个字符串放入文件中,但它会覆盖前一个。
有什么建议么?