• 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: c2pstr
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c2pstr


  • Subject: Re: c2pstr
  • From: Philip Aker <email@hidden>
  • Date: Wed, 09 Apr 2008 22:36:14 -0700

On 08-04-09, at 21:14, Charlie Dickman wrote:

Now that c2pstr is deprecated how do you convert a c string or a Cocoa string to a pascal string for use with debugStr?

I've been using

DebugStr(c2pstr ((char *) [[NSString stringWithFormat: @"%s @ %d", __func__, __LINE__] cStringUsingEncoding: NSASCIIStringEncoding]))

Str255 pstr = {0};

if( CFStringGetPascalString( (CFStringRef)nstr, pstr, 255, kCFStringEncodingUTF8 ) ) {
DebugStr( pstr );
}



Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >c2pstr (From: Charlie Dickman <email@hidden>)

  • Prev by Date: c2pstr
  • Next by Date: Re: c2pstr
  • Previous by thread: c2pstr
  • Next by thread: Re: c2pstr
  • Index(es):
    • Date
    • Thread