NSMutableData: Adding One char to a NSMutableData Object
NSMutableData: Adding One char to a NSMutableData Object
- Subject: NSMutableData: Adding One char to a NSMutableData Object
- From: Jordan Evans <email@hidden>
- Date: Sat, 14 Jan 2006 09:12:02 -0800 (PST)
How do I add one character at a time to a
NSMutableData object?
This code is supposed to be adding an 'a' to a
NSMutableData object, then incrementing it to 'b' and
then adding it, etc., on through the alphabet. Of
course this snippet doesn't work, and that's why I'm
asking how this is done. Can anyone help me with
NSData abc's?
int i;
unsigned char str[2];
unsigned char *aBuffer;
char a = 'a';
aBuffer = str;
for( i=0; i<26; i++ )
{
str[0] = a++;
str[1] = '\0';
[myData appendBytes:aBuffer length:1];
[myFile writeData:myData];
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden