[Foundation] Add NSProxy stub in order to workaround bug 59247 - #2693
Conversation
https://bugzilla.xamarin.com/show_bug.cgi?id=59247 We need to have a better solution that removes all what NSProxy does not responds to. Right now this works because NSObject implements NSObject protocol just like NSProxy, but NSProxy responds to far less selectors hence doing it internal so it is not a breaking change when we provide the correct fix.
rolfbjarne
left a comment
There was a problem hiding this comment.
Great idea about making it internal.
But maybe we can teach the linker about this, so that it automatically keeps NSProxy when WKNavigationDelegate is used? That would automatically solve the bug without customers ever seeing the problem (and thus not having to track down the solution as well).
|
Build success |
spouliot
left a comment
There was a problem hiding this comment.
Let's do the linker change in a separate PR. In fact it should not need any linker change, just do
[Preserve (typeof (NSProxy))]
on the WK*Delegate type (or member).
Next, double check that the generator keeps it - otherwise put that in a (manual) file with a partial class.
rolfbjarne
left a comment
There was a problem hiding this comment.
I'm OK with linker change in a different PR.
We need to keep NSProxy (avoid linking it) if WKNavigationDelegate or IWKNavigationDelegate is used. Unfortunately [Preserve] can't help us here because we do not generate partial interfaces rigth now, so we know WKWebView will be there and can hold a reference to it.
spouliot
left a comment
There was a problem hiding this comment.
note that, even with partial, someone using the interface IWKNavigationDelegate would not get the preserve.
|
Build failure |
|
aborted (3 hours) |
|
build |
|
Build success |
Bump maccore to bing the changes for governance and some others: * Merge 'xcode15' into 'main'. (dotnet#2690) * [Submission] Add NotaryTool Task (dotnet#2689) * [XmlDocSync] Remove the XmlDocSync reference from the project. (dotnet#2693) * [mlaunch] Refactor project structure (dotnet#2694) * [certificates] Update la_dev_apple.p12, la_distr_apple.p12 and la_mac_installer_distr.p12 (dotnet#2697) * [Governance] Update the false positives files based on the last runs. (dotnet#2698) Full idff: https://github.com/xamarin/maccore/compare/fd15821e6780a7439df467c69eb511a046adfa06...63fd14954ca3328219c5f79c754f0b329091535c
https://bugzilla.xamarin.com/show_bug.cgi?id=59247
We need to have a better solution that removes all what NSProxy does not responds to.
Right now this works because NSObject implements NSObject protocol just like NSProxy, but
NSProxy responds to far less selectors hence doing it internal so it is not a breaking change
when we provide the correct fix.