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

Re: NSData


  • Subject: Re: NSData
  • From: Clark Cox <email@hidden>
  • Date: Mon, 21 Feb 2005 07:15:10 -0500

On Sun, 20 Feb 2005 19:47:19 -0800, Michael S. Swan <email@hidden> wrote:
> thanks for the responses but I am looking to send the NSData object to a serial port not a file. In the end it will have to send a group of 512 8-bit integers. Sorry for leaving such an important detail. I have the method to send the NSData out the port just can't figure out how to fill it first.

If all you're putting in the data is 8-bit integers, then something as
simple as this will do:
char myDataArray[512] = ...;
NSData *myData = [NSData dataWithBytes: myDataArray length: sizeof
myDataArray / sizeof *myDataArray];


--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
 _______________________________________________
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

References: 
 >re:NSData (From: "Michael S. Swan" <email@hidden>)

  • Prev by Date: Re: Lining up NSViews in NSScrollView
  • Next by Date: Re: Re: Bundling UNIX apps inside Cocoa app?
  • Previous by thread: re:NSData
  • Next by thread: re:NSData
  • Index(es):
    • Date
    • Thread