https://bugzilla.xamarin.com/show_bug.cgi?id=3682
Try this:
var add = t.GetAddMethod();
add.Invoke(u, new object[] { new System.EventHandler((object b,
System.EventArgs args) => {}) });
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of slodge
Sent: Wednesday, March 21, 2012 5:35 PM
To: [email protected]
Subject: [MonoTouch] Attempting to JIT compile method... what am I doing wrong?
I've got this code currently which is failing because of a JIT error.
var u = new UIButton();
var t =u.GetType().GetEvent("TouchDown");
t.AddEventHandler(u, new System.EventHandler((object b, System.EventArgs
args) => {}));
The exception message is:
// Attempting to JIT compile method '(wrapper delegate-invoke)
<Module>:invoke_void__this___UIControl_EventHandler
(MonoTouch.UIKit.UIControl,System.EventHandler)' while running with --aot-only.
I've tried setting link to none, and I've tried adding a static:
u.TouchDown += (sender, e) => { /* ignored */ };
but that hasn't helped.
What else can I try?
All suggestions welcome!
Thanks
Stuart
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/Attempting-to-JIT-compile-method-what-am-I-doing-wrong-tp4492920p4492920.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch