简体   繁体   English

将字节数组代码从C转换为Swift

[英]Convert byte array code from c to swift

I have this line in a header file at an objective c project. 我在目标c项目的头文件中有此行。

static const char my_bytes[] = { -30, 10, 90}

I want to write it in swift, how can I do it? 我想快点写,怎么办?

let my_bytes : [CChar] = [-30, 10, 90]

CChar is simply an alias for Int8 . CChar仅仅是一个别名Int8 You can read more about it in Interacting with C API . 您可以在与C API交互中阅读有关它的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM