This is crazy 
I simply want to write an NSString to file.
When I do this:
All is fine, file get's written, no problems
Buuuut, this method has been deprecated by Apple since 10.4, you now need to specify the encoding, and optionally where you want to return errors.
So, the last line is replace by this one:
And then, BAM, uncaught exception:
I'm really getting nuts, maybe it's getting too late
I tried several encodings (UTF8, ASCII even UTF16), they all spawn errors.
Any ideas?
I simply want to write an NSString to file.
When I do this:
Code:
NSString *frameString = @"You're the banana king, Charlie!";
NSString *path = @"/Users/me/textFile.txt";
[frameString writeToFile:path atomically:YES];
All is fine, file get's written, no problems
Buuuut, this method has been deprecated by Apple since 10.4, you now need to specify the encoding, and optionally where you want to return errors.
So, the last line is replace by this one:
Code:
[frameString writeToFile:path atomically:YES encoding:NSUnicodeStringEncoding error:NULL];
And then, BAM, uncaught exception:
Code:
2009-07-04 01:47:44.315 iPhoneStreamingPlayer[50097:20b] *** -[NSConcreteData writeToFile:atomically:encoding:error:]: unrecognized selector sent to instance 0x1032000
2009-07-04 01:47:44.317 iPhoneStreamingPlayer[50097:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSConcreteData writeToFile:atomically:encoding:error:]: unrecognized selector sent to instance 0x1032000'
I'm really getting nuts, maybe it's getting too late
I tried several encodings (UTF8, ASCII even UTF16), they all spawn errors.
Any ideas?
Last edited: