• 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: problem with NSString, UTF8, pathnames
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with NSString, UTF8, pathnames


  • Subject: Re: problem with NSString, UTF8, pathnames
  • From: "Clark Cox" <email@hidden>
  • Date: Thu, 25 Oct 2007 12:07:36 -0700

On 10/25/07, James Stein <email@hidden> wrote:
> To my surprise:
> an NSString returned by Cocoa will cause NSLog to crash.
> Details:

[snip]

> But whatever, is there a workaround, or must I consider this as harmful?
>     NSLog( [validCocoaObject description] );

It is harmful, always use this:

NSLog(@"%@", [validCocoaObject description] );

The same goes for any printf-like function: if there is any chance
that the string might contain '%', don't pass it as the first
parameter.

--
Clark S. Cox III
email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: problem with NSString, UTF8, pathnames
      • From: "Sean McBride" <email@hidden>
    • Re: problem with NSString, UTF8, pathnames
      • From: "stephen joseph butler" <email@hidden>
References: 
 >problem with NSString, UTF8, pathnames (From: "James Stein" <email@hidden>)

  • Prev by Date: Re: A problematic combination of malloc and getCharacters.
  • Next by Date: Re: starting cocoa in different thread
  • Previous by thread: Re: problem with NSString, UTF8, pathnames
  • Next by thread: Re: problem with NSString, UTF8, pathnames
  • Index(es):
    • Date
    • Thread