Created
February 4, 2013 01:23
-
-
Save Ridwy/4704540 to your computer and use it in GitHub Desktop.
-[NSMutableData appendBytes:length:] copies specific buffer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
commented
Jun 24, 2016
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment