全部博文(322)
分类: BSD
2012-02-24 15:10:41
NSString *myString = @"WorkList"; //Assuming your string is here
NSData *stringData = [myString dataUsingEncoding:NSASCIIStringEncoding]; //This is the NSData representation of the string
NSInteger len = [myString length];
Byte *bytes = (Byte*)malloc(len);
memcpy(bytes, [stringData bytes], len);
for(int i=0; i<[myString length]; i++){
NSLog(@"byte[%d] is %d",i,bytes[i]);
}