I'm reading and writing variables to a text file in my app.
It works perfectly fine when testing it in the simulator, but somehow when testing it on the iPhone it can only read the file but not write/save anything
Here's my method for saving my variables ("\n" is used for line breaking):
NSString path = [[NSBundle mainBundle] pathForResource:@"settings" ofType:@"txt"];
- (void)saveSettings {
[[NSString stringWithFormat:@"%d\n%d", firstInt, secInt] writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
As I said: works in the simulator but doesn't work on any iDevice.
Does anyone got a idea why it's not working? Changing "atomically" to "NO" does nothing