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

NSData object


  • Subject: NSData object
  • From: "Peter Karlsson" <email@hidden>
  • Date: Fri, 11 Apr 2003 07:28:46 +0000

Dear list!

I have a NSData object like this:

// code snippet
NSData *myData = [NSData dataWithContentsOfFile:thePath];

Now I want to read 2 bytes from this object (from offset 5 and 6). These 2 bytes are in a nybble-ized format like this:

0000llll (offset 5 from start of myData object)
hhhh0000 (offset 6 from start of myData object)
l = low nybble, h = high nybble

So I end up here with 1 byte of data. I want to copy that byte to another NSData object at offset 0, lets call that object myData2.

Can someone help me with this code please?

Peter

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
_______________________________________________
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.
  • Follow-Ups:
    • Re: NSData object
      • From: John Anderson <email@hidden>
  • Prev by Date: toolbar item validation extremely inefficient
  • Next by Date: NSTextField Change Characters!
  • Previous by thread: Re: toolbar item validation extremely inefficient
  • Next by thread: Re: NSData object
  • Index(es):
    • Date
    • Thread