What's happened with CMutablePointer and CConstPointer in Xcode Beta3?

。_饼干妹妹 提交于 2019-12-10 20:57:01

问题


What's happened with CMutablePointer and CConstPointer in Xcode Beta3?

Code that successfully compiles in Beta2 fails with the errors:

Use of undeclared type 'CMutablePointer'

回答1:


Use UnsafePointer and ConstUnsafePointer respectively.

From the Release Notes:

APIs imported from C that use C pointers are now imported with a much simpler API type structure which is more predictable, preserves const mutability in more cases, and preserves __autoreleased pointer information.  Now you will see UnsafePointer, ConstUnsafePointer, AutoreleasingUnsafePointer, etc.  Function pointers are also imported now, and can be referenced and passed around.  However, you cannot call a C function pointer or convert a closure to C function pointer type.!



来源:https://stackoverflow.com/questions/24632588/whats-happened-with-cmutablepointer-and-cconstpointer-in-xcode-beta3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!