-
Notifications
You must be signed in to change notification settings - Fork 555
Description
This seems like a corner-case: the dynamic registrar gets the signature from native code, which says that the method returns an id, and then we've bound it as an IntPtr, and the dynamic registrar doesn't know how to return a native id given a managed IntPtr. Looking at the code I'm not sure it ever worked (fwiw it works fine if native code does not define the signature).
#15677 (comment)
Steps to Reproduce
- See [iOS 16][Xamarin/net6] Overriding UITextField.SelectedTextRange crashes the app #15677
- Build for simulator -> crash
- Enable the static registrar -> works
Expected Behavior
The same application code should work, identically, for both the static and dynamic registrar.
Actual Behavior
The dynamic registrar aborts.
Xamarin.iOS: Don't know how to marshal a return value of type 'System.IntPtr'. Please file a bug with a test case at https://github.com/xamarin/xamarin-macios/issues/new
This means using IntPtr cannot be a workaround without requiring the static registrar, which has a large build time impact for the simulator.
Environment
- xamarin-macios
main - Xcode 14 beta 5
- iOS 16 beta 5/6