如何在objective-c中创建字节数组?
我有一些这样的数据:0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89,我想将其准备为字节数组。

最佳答案

您可以简单地使用纯c语法,这在objective-c中是可用的:

const char myByteArray[] = {
    0x12,0x23,0x34,0x45,
    0x56,0x67,0x78,0x89,
    0x12,0x23,0x34,0x45,
    0x56,0x67,0x78,0x89 };

09-19 22:29