Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
As returned by UIViewController.(Top|Bottom)LayoutGuide otherwise you can't use them in NSLayoutConstraint.Create which is what they are for.
UILayoutSupportWrapper can't inherit from NSObject, because it would mean we could end up with multiple managed wrappers for the same native object (which breaks us badly).
But we can fix NSLayoutConstraint.Create to accept INativeObject as well.
That would solve this one indeed but then who knows which other API (or just the client wanting to pass around the object in existing code) will then require fixing.
If it's impossible to make it inherit from NSObject, couldn't we add a cast operator or method to convert it to NSObject?
You can use ObjCRuntime.Runtime.GetNSObject (iface.Handle) if you really need an NSObject.
However please file enhancement requests if you find any API that takes NSObject and should accept these interfaces, we need to fix these cases.
Fixed (by adding a NSLayoutConstraint.Create overload that takes INativeObjects).
*** Bug 16920 has been marked as a duplicate of this bug. ***
Fixed in comment #5.