I have a very basic question about how to a write a NSString to a file. I have tryed the following way, but it doesn't seem to work:
NSString *filePath = [[NSBundle mainBundle] pathForResource
"Gameinf" ofType
"txt"];
NSString* st = @"a1";
[st writeToFile:filePath atomically:FALSE encoding:NSUTF8StringEncoding error:nil];
And also just:
NSString* st = @"a1";
[st writeToFile
"Gameinf.txt" atomically:FALSE encoding:NSUTF8StringEncoding error:nil];
I would just want to save the game level, where the player. So that the player could continue from that level, when he restarts the program.
Any help would be appreciated.
NSString *filePath = [[NSBundle mainBundle] pathForResource
NSString* st = @"a1";
[st writeToFile:filePath atomically:FALSE encoding:NSUTF8StringEncoding error:nil];
And also just:
NSString* st = @"a1";
[st writeToFile
I would just want to save the game level, where the player. So that the player could continue from that level, when he restarts the program.
Any help would be appreciated.