Hi,

Is there a way how to add event handlers through reflection on iOS? This piece 
of code fails on device:

var e = target.GetType().GetEvent("MoveNextCompleted");
if (e != null)
e.AddEventHandler(target, new EventHandler(AsyncEnumerable_MoveNextCompleted));

with this exception

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper 
delegate-invoke) <Module>:invoke_void__this___OnlineEntityQuery_EventHandler 
(MobileCrm.UI.OnlineEntityQuery,System.EventHandler)' while running with 
--aot-only.

  at System.Reflection.EventInfo.AddEventFrame[OnlineEntityQuery,EventHandler] 
(System.Reflection.AddEvent`2 addEvent, System.Object obj, System.Object dele) 
[0x00000] in <filename unknown>:0
  at System.Reflection.EventInfo.AddEventHandler (System.Object target, 
System.Delegate handler) [0x0006e] in 
/Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/EventInfo.cs:100

Best regards,
Michal Sartoris
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to