• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Omission of % character when loading a string from a file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Omission of % character when loading a string from a file? (From: Jan Van Boghout <email@hidden>)

  • Prev by Date: Re: Omission of % character when loading a string from a file?
  • Next by Date: Re: Omission of % character when loading a string from a file?
  • Previous by thread: Re: Omission of % character when loading a string from a file?
  • Next by thread: Re: Omission of % character when loading a string from a file?
  • Index(es):
    • Date
    • Thread