字节数组在Objective-C [英] Byte array in objective-c
本文介绍了字节数组在Objective-C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何创建在Objective-C的字节数组?
How can I create a byte array in Objective-C?
我有这样一些数据: 0×12,0x23,0x34,×45,0x56,0x67,0x78,0x89上,0×12,0x23,0x34,×45,0x56,0x67,0x78,0x89上
,我想prepare为字节数组。
I have some data like this:0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89
, that I want to prepare as a byte array.
推荐答案
您可以简单地使用纯C语法,这是在Objective-C提供:
You can simply use plain C syntax, which is available in Objective-C:
const char myByteArray[] = {
0x12,0x23,0x34,0x45,
0x56,0x67,0x78,0x89,
0x12,0x23,0x34,0x45,
0x56,0x67,0x78,0x89 };
这篇关于字节数组在Objective-C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文