ios NSData转Byte 、unsigned char

来源:互联网 发布:java int 除法取整 编辑:程序博客网 时间:2024/06/05 12:04

    NSData *data;  //假设data已经赋值

    Byte *byteArray = (Byte *)[data bytes];

   

    for (int i=0 ; i<[data length]; i++) {

        NSLog(@"-----row =%d  and byte = %d",i,byteArray[i]);

    }

    


======Byte 其实就是unsigned char ==见如下定义====


typedefUInt8                           Byte;

typedefunsigned char                   UInt8;



0 0
原创粉丝点击