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

Re: NSData Question


  • Subject: Re: NSData Question
  • From: Wade Tregaskis <email@hidden>
  • Date: Fri, 10 Oct 2003 00:31:44 +1000

I know what I have to do in php, there the data to send is:
"\xFF\xFF\xFF\xFFmyCommand\n"
And i know that FF is 255 in decimal in the ascii table.
My problem is that i don't know how i can add this value to the NSData
*data.

const static UInt32 prefix = 0xffff;
NSMutableData *myMessage = [NSMutableData dataWithBytes:&prefix length:sizeof(UInt32)];

Then use NSMutableData's append methods to add your string on.

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.

References: 
 >NSData Question (From: David Dauer <email@hidden>)

  • Prev by Date: Right Clicks on NSTableView column headers
  • Next by Date: RE: Error: dsNoPk5 (22): package 5 not present
  • Previous by thread: Re: NSData Question
  • Next by thread: Re: NSData Question
  • Index(es):
    • Date
    • Thread