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

Hide advanced NSObject members to follow Xamarin.Android #8439

Closed
rolfbjarne opened this issue Apr 21, 2020 · 2 comments · Fixed by #19106
Closed

Hide advanced NSObject members to follow Xamarin.Android #8439

rolfbjarne opened this issue Apr 21, 2020 · 2 comments · Fixed by #19106
Assignees
Labels
enhancement The issue or pull request is an enhancement good first issue This is a good first issue for someone to start working with our code iOS Issues affecting iOS macOS Issues affecting macOS
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Apr 21, 2020

Suggestion:

Hide members from NSObject that customers shouldn't use.

Candidates:

Ref:

@rolfbjarne rolfbjarne added the enhancement The issue or pull request is an enhancement label Apr 21, 2020
@rolfbjarne rolfbjarne added this to the .NET 5 milestone Apr 21, 2020
@rolfbjarne rolfbjarne added iOS Issues affecting iOS macOS Issues affecting macOS labels Apr 21, 2020
@spouliot
Copy link
Contributor

Semi random thoughts...

I do not see an issue hiding the properties ([Super]Handle) from intellisense but IMO they should remain visible in the debugger.

The only times I recall seeing NSObject constructors are related to manual binding code for

  • adding a NSObject-based pointer to a weak/native managed collection (processed by native code);
  • create an instance of an unknown type to get its description

TBH we forgot to make them protected in XAMCORE_2_0 like the generated bindings for the subclasses. So the same solution is that use Runtime.GetNSObject<NSObject> (ptr) if it's really needed (not that we're talking about removing them).

@dalexsoto
Copy link
Member

By Hide you mean adding EditorBrowsable with Advanced or Never right? If so 👍 but I have to agree with @spouliot that [Super]Handle should still be visible under the debugger.

@rolfbjarne rolfbjarne added dotnet-pri3 .NET 6: wishlist for stable release estimate-2d labels Feb 3, 2021
@rolfbjarne rolfbjarne modified the milestones: .NET 6, .NET 7 Dec 9, 2021
@rolfbjarne rolfbjarne added good first issue This is a good first issue for someone to start working with our code and removed dotnet-pri3 .NET 6: wishlist for stable release estimate-2d labels Aug 26, 2022
@rolfbjarne rolfbjarne modified the milestones: .NET 7, .NET 8 Aug 26, 2022
@rolfbjarne rolfbjarne modified the milestones: .NET 8, .NET 9 Sep 12, 2023
@haritha-mohan haritha-mohan self-assigned this Sep 21, 2023
haritha-mohan added a commit to haritha-mohan/xamarin-macios that referenced this issue Sep 27, 2023
Fixes xamarin#8439
Could only adjust the debugger visibility of the IsDirectBidning
member because the targets of the of the DebuggerBrowsable attribute
does not include methods..

Ref: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerbrowsableattribute?view=net-7.0
@github-project-automation github-project-automation bot moved this to Done in .NET 9 Aug 27, 2024
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 good first issue This is a good first issue for someone to start working with our code iOS Issues affecting iOS macOS Issues affecting macOS
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants