• 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
getting bytes out of NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting bytes out of NSData


  • Subject: getting bytes out of NSData
  • From: Koen van der Drift <email@hidden>
  • Date: Fri, 22 Jul 2005 20:26:02 -0400

Hi,

Which of these two methods is faster/more efficient to get bytes out of an NSData object:


const char *data;

        data = (const char *)[myData bytes];
        aSymbol = [self symbolForChar: data[i]];

or:

        unsigned char buffer;

        [myData getBytes: &buffer range: NSMakeRange( i, 1 )];
        aSymbol = [self symbolForChar: buffer];


thanks,

- Koen.

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


  • Follow-Ups:
    • Re: getting bytes out of NSData
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Coalesced updates = pain
  • Next by Date: Re: Coalesced updates = pain
  • Previous by thread: Re: Coalesced updates = pain
  • Next by thread: Re: getting bytes out of NSData
  • Index(es):
    • Date
    • Thread