qq_花开花谢_0
已经回答,但可以概括一下以帮助其他读者: //Here: NSData * fileData; uint8_t * bytePtr = (uint8_t * )[fileData bytes]; // Here, For getting individual bytes from fileData, uint8_t is used. // You may choose any other data type per your need, eg. uint16, int32, char, uchar, ... . // Make sure, fileData has atleast number of bytes that a single byte chunk would need. eg. for int32, fileData length must be > 4 bytes. Makes sense ? // Now, if you want to access whole data (fileData) as an array of uint8_t NSInteger totalData = [fileData length] / sizeof(uint8_t); for (int i = 0 ; i < totalData; i ++) { NSLog(@"data byte chunk : %x", bytePtr[i]); }