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

[Foundation/UIKit] Provide LoadObject[s] methods that return the expected type in the callback. Fixes #59049. #2638

Merged
merged 2 commits into from
Sep 12, 2017

Conversation

rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Sep 11, 2017

The callback for these LoadObject[s] methods take an INSItemProviderReading parameter. This tells our runtime that we must provide an instance of a managed object that implements this interface (but nothing else), so we create a NSItemProviderReadingWrapper instance, which complies with the API (since the wrapper type implements the corresponding interface).

Unfortunately these methods are supposed to return an instance of the passed-in type, so in order to comply with this soft (documentation-only) requirement, provide a wrapper method that creates instances of the right types.

https://bugzilla.xamarin.com/show_bug.cgi?id=59049

@rolfbjarne rolfbjarne added the do-not-merge Do not merge this pull request label Sep 11, 2017
@rolfbjarne
Copy link
Member Author

dont-merge since I haven't tested the XM binding change, since I don't have High Sierra installed yet. @VincentDondain / @timrisi: to either of you have High Sierra installed to test this using @chamon's test case from bug #59049?

…cted type in the callback. Fixes #59049.

The callback for these LoadObject[s] methods take an INSItemProviderReading
parameter. This tells our runtime that we must provide an instance of a
managed object that implements this interface (but nothing else), so we create
a `NSItemProviderReadingWrapper` instance, which complies with the API (since
the wrapper type implements the corresponding interface).

Unfortunately these methods are supposed to return an instance of the passed-
in type, so in order to comply with this soft (documentation-only)
requirement, provide a wrapper method that creates instances of the right
types.

https://bugzilla.xamarin.com/show_bug.cgi?id=59049
@monojenkins
Copy link
Collaborator

Build failure

@spouliot
Copy link
Contributor

❤️ much nicer API

@monojenkins
Copy link
Collaborator

Build failure

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ it

@VincentDondain
Copy link
Contributor

@timrisi I don't have my High Sierra machine with me today can you try it with yours?

@rolfbjarne
Copy link
Member Author

Turns out both samples from the bug are iOS samples, so I was able to test both (and they work).

@rolfbjarne rolfbjarne removed the do-not-merge Do not merge this pull request label Sep 11, 2017
@monojenkins
Copy link
Collaborator

Build failure

@VincentDondain
Copy link
Contributor

build

@monojenkins
Copy link
Collaborator

Build success

@spouliot spouliot merged commit 343c0b3 into xamarin:xcode9 Sep 12, 2017
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

Successfully merging this pull request may close these issues.

6 participants