I have an app that is collecting data from user inputs on a pretty regular basis. I'm writing the data to a text file and saving it to the disk. I usually call writeToFile:
, but the issue with that is that it is constantly overwritten each time. I can't create different file names either because I'd like to keep it all in one file for the user to access later. I'm not sure how to even go about this, does anyone have any recommendations?
- (void)saveToTextFile {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"usernotes"];
NSString *savedString = [NSString stringWithFormat:@" First:%@ Second: %@", firstOne, secondOne];
[savedString appendToFile:@"usernotes"];
}
I'm getting an error that says No visible interface for NSString declares the selector appendToFile.