Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commented out validateXXX funcs for swift are invalid #281

Closed
Aloisius opened this issue May 5, 2015 · 1 comment
Closed

Commented out validateXXX funcs for swift are invalid #281

Aloisius opened this issue May 5, 2015 · 1 comment

Comments

@Aloisius
Copy link

Aloisius commented May 5, 2015

The commented out validate functions in the swift machine template look something like this:

 // func validate<$Attribute.name.initialCapitalString$>(value: AutoreleasingUnsafePointer<AnyObject>, error: NSErrorPointer) {}

However, the format should be:

 // func validate<$Attribute.name.initialCapitalString$>(value: AutoreleasingUnsafeMutablePointer<AnyObject?>, error: NSErrorPointer) -> Bool {}

It was changed on 8/4/2014 https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/RevisionHistory.html:

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.

The return of Bool however seems to be undocumented, but the resulting function is supposed to return a Bool and funcs with that signature appear to be called properly.

@atomicbird
Copy link
Collaborator

Fixed on branch feature/swift12. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants