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.
Created attachment 3196 [details]
Clicking a UIBtutton contained in a UIView contained in a UIViewElement results in unrecognized selector sent to instance.
MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[__NSMallocBlock__ BridgeSelector]: unrecognized selector sent to instance 0x100970f0
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string,intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
This occurs with both outlet and Action.
The HasButtonVC instance is freed by the GC because it's not referenced by anyone.
If you declare hasButtonVC as a class variable in MainVC.cs the crash goes away.
It is a really bad practice to take the View from a UIViewController and put it on a standard UIView that is being managed by another controller.
Not to mention that in this case, it is being added to a UITableViewCell, which is even worse.