Re: NSData
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>) |