Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of undeclared type AutoreleasingUnsafePointer Xcode 6 beta 6

Tags:

swift

xcode6

The following code gives a compiler error "Use of undeclared type AutoreleasingUnsafePointer"

    var myString: AutoreleasingUnsafePointer<NSString?>

Have I missed a compiler setup step?

Thanks

like image 460
iphaaw Avatar asked Feb 12 '23 02:02

iphaaw


2 Answers

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

like image 54
Antonio Avatar answered Apr 26 '23 06:04

Antonio


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
like image 43
Sophy Swicz Avatar answered Apr 26 '23 06:04

Sophy Swicz