Skip to content

Instantly share code, notes, and snippets.

@fousa
Created July 23, 2012 21:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fousa/3166324 to your computer and use it in GitHub Desktop.
Save fousa/3166324 to your computer and use it in GitHub Desktop.
NSNumber to NSData
NSUInteger index = 999;
NSData *payload = [NSData dataWithBytes:&index length:sizeof(index)];
@alexlee002
Copy link

consider this:

double value = 12345.6789f;
NSData *payload = ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment