[MonoTouch] Attempting to JIT compile method... what am I doing wrong?

Michal Sartoris miso at resco.net
Wed Mar 21 16:43:33 UTC 2012


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: monotouch-bounces at lists.ximian.com [mailto:monotouch-bounces at lists.ximian.com] On Behalf Of slodge
Sent: Wednesday, March 21, 2012 5:35 PM
To: monotouch at lists.ximian.com
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
MonoTouch at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch




More information about the MonoTouch mailing list