Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[foundation] Fix inlined 'NSUserActivity (IntentsAdditions)' to work …
…if nothing else from Intents is used. Fixes #4894 (#4974) The selectors `suggestedInvocationPhrase` and `setSuggestedInvocationPhrase` needs Intents.framework to be loaded into memory. Otherwise an exception occurs: ``` Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[NSUserActivity setSuggestedInvocationPhrase:]: unrecognized selector sent to instance 0x19cb3f00 ``` When the linker is enabled there's no clue (e.g. namespaces from preserved types) that `Intents` is required to call the property. The fix is to provide an hint that will force the linker to keep a type (a small enum available in all platforms in this case) which tells `mtouch` (based on the type's namespace) to instruct the native linker (Apple's `ld`) to [weak]link the Intents.framework in the application executable. Note: other selections from the category works fine. reference: #4894
- Loading branch information
f4dbb68
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.
❌ Build was (probably) aborted
🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.13', Test docs' 🔥 : hudson.AbortException: Xamarin.Mac tests on macOS 10.13 failed (xammac_tests)
✅ Build succeeded
✅ API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
🔥 Xamarin.Mac tests on macOS 10.13 failed (xammac_tests) 🔥
✅ Test run succeeded