Skip to content

Instantly share code, notes, and snippets.

@Ridwy
Created February 4, 2013 01:23
Show Gist options
  • Save Ridwy/4704540 to your computer and use it in GitHub Desktop.
Save Ridwy/4704540 to your computer and use it in GitHub Desktop.
-[NSMutableData appendBytes:length:] copies specific buffer.
NSMutableData* data = [NSMutableData data];
char str[] = "foo";
[data appendBytes:str length:sizeof(str)];
NSLog(@"%s %s", [data bytes], str); // foo foo
str[0] = 0;
NSLog(@"%s %s", [data bytes], str); // foo
@mconintet
Copy link

mconintet commented Jun 24, 2016

:trollface:

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