-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add pointer to pointer support #244
Conversation
To test this pull request I made several programs available. This program loads a nib file and and displays it. Directions:
This program test the use of (NS)Error.
The output should look like this:
|
I think this could be a good general solution. @tmc thoughts? |
@tmc Any questions or comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pointer to pointer types are commonly used to provide a method a way to communicate information to calling methods. A popular example of this is to use NSError to communicate any error information. This pull request adds the ability for DarwinKit to correctly use pointer to pointer types so they can work.
This change uses a new rule where if a parameter is a pointer to a pointer type (e.g. NSError **error), the user is to use the Go wrapper for that type and wrap the variable with unsafe.Pointer(&theVariable).
So for a parameter like NSError **err, the Go code would declare an Error instance and then use that instance in the method like this: unsafe.Pointer(&err)