Re: Omission of % character when loading a string from a file?
Re: Omission of % character when loading a string from a file?
- Subject: Re: Omission of % character when loading a string from a file?
- From: Andy Lee <email@hidden>
- Date: Thu, 26 Dec 2002 12:42:47 -0500
At 6:13 PM +0100 12/26/02, Jan Van Boghout wrote:
Why is it that when I load a plain text file as a string, every %
character seems to disappear completely?
I use : [[NSMutableString alloc] initWithContentsOfFile:path]
How are you finding out that the % characters are missing? If you're
doing something like...
NSLog(myString);
...then myString is used as a format string and the % characters are
interpreted as part of the format specification, and therefore won't
be printed. Make sure you're doing something like this instead:
NSLog("%s", myString);
The same applies if you're using printf() rather than NSLog().
--Andy
_______________________________________________
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.