Xcode Beta3中的CMutablePointer和CConstPointer发生了什么?

时间:2014-07-08 13:02:34

标签: xcode swift beta

Xcode Beta3中的CMutablePointer和CConstPointer发生了什么?

在Beta2中成功编译的代码失败并显示错误:

Use of undeclared type 'CMutablePointer'

1 个答案:

答案 0 :(得分:14)

分别使用UnsafePointer和ConstUnsafePointer。

从发行说明:

  

从C导入的使用C指针的API现在使用更简单的API类型导入   结构更可预测,在更多情况下保留const可变性,并保留   __autoreleased指针信息。现在你将看到UnsafePointer,   ConstUnsafePointer,AutoreleasingUnsafePointer等。函数指针也是   现在导入,可以引用和传递。但是,你不能叫C   函数指针或将闭包转换为C函数指针类型。!