• 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: char Array to NSString to cString?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: char Array to NSString to cString?


  • Subject: Re: char Array to NSString to cString?
  • From: Tomas Franzén <email@hidden>
  • Date: Fri, 1 Jun 2007 19:18:09 +0200


On 1 jun 2007, at 17.15, Vince Ackerman wrote:

I'm having a bit of trouble trying to convert an array of 7 (unsigned char) to a NSString. I need to pass this array of hex values to another object that is expecting an NSString that it will convert to a C string and send it out the serial port

(unsigned char) myArray[7];

Hi,
Unless I've missed something, can't you just write it directly, instead of going through NSString (or NSData)?


write(fileDescriptor, myArray, sizeof(myArray));

Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >char Array to NSString to cString? (From: Vince Ackerman <email@hidden>)

  • Prev by Date: NSTabViewItem Label binding
  • Next by Date: Re: NSObject -poseAs:
  • Previous by thread: Re: char Array to NSString to cString?
  • Next by thread: Re: char Array to NSString to cString?
  • Index(es):
    • Date
    • Thread