I have text files that contain some basic data that I need for my app. I can read the files and I get the file path with:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Money" ofType:@"txt"];
To write to the file I would think I would use:
[[HoldString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:fileAtPath atomically:NO];
This does not work though, I have also tried geting the file path with:
NSString* filePath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString* fileAtPath = [filePath stringByAppendingPathComponent:@"Money.txt"];
None of these work. I would like to be able to read from the file not using CoreData.