In C# .net we can run code dynamically by using System.Codedom.Provider
. Like the same is there any possibility to execute the code dynamically in Monotouch (iPhone/iPad).
Thanks in advance,
In C# .net we can run code dynamically by using System.Codedom.Provider
. Like the same is there any possibility to execute the code dynamically in Monotouch (iPhone/iPad).
Thanks in advance,
Not possible. First because the limitation in how Xamarin.iOS actually works (it doesn't run like a regular .NET apps, but instead compiled to a plain iOS app) and because the security model in Apple Appstore. After all, you can't declare an app to be safe or regulation conforming if the behavior could change anytime.
Since Xamarin.iOS version 7.2 there is some basic support for C#'s dynamic feature. From the release notes:
I've successfully compiled and executed dynamic access of anonymous types:
Currently you need to add a Microsoft.CSharp.dll as a dependency -- otherwise you'll get an exception similar to this:
Unfortunately neither ExpandoObject nor Json.Net's JObject work right now:
I've created two bug reports for this: https://bugzilla.xamarin.com/show_bug.cgi?id=20081 and https://bugzilla.xamarin.com/show_bug.cgi?id=20082.