• 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: from CFDataRef to NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: from CFDataRef to NSString


  • Subject: Re: from CFDataRef to NSString
  • From: Michael Vannorsdel <email@hidden>
  • Date: Tue, 10 Jun 2008 04:40:32 -0600

Something like:

messageString = [[NSString alloc] initWithData:(NSData*)data encoding:NSASCIIStringEncoding];

the encoding type will depend on what encoding you expect the data to be in.


On Jun 10, 2008, at 4:08 AM, Angelo Chen wrote:

What is the correct way to cast from CFDataRef to NSString, I have this code:

CFDataRef data;
NSString *messageString = [NSString stringWithCString:CFDataGetBytePtr(data)];


it always return this warning, any idea?

warning:pointer targets in passing argument 1 of 'stringWithCString:' differ in signedness

Thanks

_______________________________________________

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


References: 
 >from CFDataRef to NSString (From: Angelo Chen <email@hidden>)

  • Prev by Date: Re: Updating a progress bar from a code loop
  • Next by Date: checking application is document based application or not
  • Previous by thread: from CFDataRef to NSString
  • Next by thread: checking application is document based application or not
  • Index(es):
    • Date
    • Thread