问题
The following code gives a compiler error "Use of undeclared type AutoreleasingUnsafePointer"
var myString: AutoreleasingUnsafePointer<NSString?>
Have I missed a compiler setup step?
Thanks
回答1:
As stated in the documentation revision history
Updated the Pointers section to reflect that
UnsafePointerhas been replaced withUnsafeMutablePointer,ConstUnsafePointerhas been replaced withUnsafePointer, andAutoreleasingUnsafePointerhas been replaced withAutoreleasingUnsafeMutablePointer.
So you have to use AutoreleasingUnsafeMutablePointer
回答2:
I was having the same problem, but, using NSError. In new version of Xcode (6.4) and Swift (previous version 2) it's necessary to use:
var err: AutoreleasingUnsafeMutablePointer<NSError?> = nil
来源:https://stackoverflow.com/questions/25699567/use-of-undeclared-type-autoreleasingunsafepointer-xcode-6-beta-6