Compiling lambdas and invoking delegates on the device in Monotouch

后端 未结 1 2117
自闭症患者
自闭症患者 2021-02-14 17:01

I am currently porting a .NET codebase in MonoTouch and I\'m currently working on a method that receives an Expression. I\'m trying to compile it, and then

1条回答
  •  孤独总比滥情好
    2021-02-14 17:38

    Not familiar with System.Linq.Expressions, but presumably it involves runtime code generation.

    There is no JIT in iOS, all code must be compiled ahead-of-time. The same restriction does not apply in the simulator, hence your code runs there.

    See here.

    The Compile() method is not supported on the iOS device, since the device prevents the JIT engine from running. Compile itself is implemented using System.Reflection.Emit and this in turns requires a functioning JIT. So the above code would never wor kwith expression trees.

    0 讨论(0)
提交回复
热议问题