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

[mediaaccessibility] Update for Xcode 11 beta 5 #6733

Merged
merged 1 commit into from
Aug 7, 2019

Conversation

spouliot
Copy link
Contributor

@spouliot spouliot commented Aug 7, 2019

No description provided.

@spouliot spouliot added the enhancement The issue or pull request is an enhancement label Aug 7, 2019
@spouliot spouliot added this to the xcode11 milestone Aug 7, 2019
// CFAttributedString is “toll-free bridged” with its Foundation counterpart, NSAttributedString.
// https://developer.apple.com/documentation/corefoundation/cfattributedstring?language=objc
if ((strings == null) || (strings.Length == 0))
MACaptionAppearanceDidDisplayCaptions (IntPtr.Zero);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we use IntPtr.Zero in place of null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's basically all the same, just like 0 would be - but

  • C# is type safe (unlike C/C++); and
  • IntPtr is a struct not a reference type so it can't be set to null; and

We could use pointers in C# but that would expose a lot of unsafe code everywhere... which does not make great API.

We could have a 2nd [DllImport] with a different signature - but that would bloat the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the detailed explanation, makes a lot of sense! ❤️

@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
Generator Diff (no change)
Test run succeeded

@spouliot spouliot merged commit 193ae8b into xamarin:xcode11 Aug 7, 2019
@spouliot spouliot deleted the xcode11-mediaaccessibility-b5 branch August 7, 2019 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants