Use of undeclared type AutoreleasingUnsafePointer Xcode 6 beta 6

萝らか妹 提交于 2019-12-07 07:05:02

问题


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 UnsafePointer has been replaced with UnsafeMutablePointer, ConstUnsafePointer has been replaced with UnsafePointer, and AutoreleasingUnsafePointer has been replaced with AutoreleasingUnsafeMutablePointer.

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

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