Chinaunix首页 | 论坛 | 博客
  • 博客访问: 871217
  • 博文数量: 322
  • 博客积分: 6688
  • 博客等级: 准将
  • 技术积分: 3626
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-19 11:26
文章分类

全部博文(322)

文章存档

2013年(5)

2012年(66)

2011年(87)

2010年(164)

分类: 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]);

        }

阅读(702) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~