stringWithUTF8String: Question
stringWithUTF8String: Question
- Subject: stringWithUTF8String: Question
- From: Karl Goiser <email@hidden>
- Date: Tue, 6 May 2003 16:14:25 +1000
G'Day,
I am having trouble with the stringWithUTF8String: method:
I am reading data from a file - UTF data - like this:
NSData * contentsData = [NSData dataWithContentsOfFile: pathName];
if (contentsData) {
contents = [NSString stringWithUTF8String: [contentsData
bytes]];
...
Intermittently, contents will return as nil. Well, actually, about 50%
of the time! I can sit in ProjectBuilder, and hit command-R and
sometimes this routine will work and sometimes it will fail.
This is always on the same, unchanged file which is about 700 bytes
long.
Does anybody have any inkling why this might be so? It's got me!
Thanks in advance,
Karl
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.