问题
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