[MonoTouch] Attempting to JIT compile method... what am I doing wrong?
Stuart Lodge
me at slodge.com
Wed Mar 21 16:47:05 UTC 2012
If necessary I can drop back to what you've put, but I'd prefer to use
reflection if I can... this simple test code is not the full thing.
And I'm using linker set to none - so I didn't expect the linker to remove
anything. Even if I can't fix this I would love to try to understand this
Stuart
On 21 March 2012 16:42, Nic Wise <nicw at fastchicken.co.nz> wrote:
> Whats wrong with
>
> var u = new UIButton();
> u.TouchDown += (btn, evt) => {
> };
>
> ??
>
> as you dont directly refer to TouchDown, it's most likely stripped by
> the linker.
>
> On Wed, Mar 21, 2012 at 16:34, slodge <me at slodge.com> wrote:
> > 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-tp4492918p4492918.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
>
>
>
> --
> Nic Wise
> t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
> b. http://www.fastchicken.co.nz/
>
> Nearest Bus: find when the next bus is coming to your stop.
> http://goo.gl/Vcz1p
> mobileAgent (for FreeAgent): get your accounts in your pocket.
> http://goo.gl/IuBU
> Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
> London Bike App: Find the nearest Boris Bike, and get riding!
> http://goo.gl/Icp2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monotouch/attachments/20120321/cd70d9f8/attachment.html>
More information about the MonoTouch
mailing list