I am trying to reorder an dictionary by using this line:
var orderedPairs = myturn.OrderBy(pair => pair.Value.Get<string>("lastMoveTime")).Select(pair => pair.Value);
It works perfectly in the editor but when compiling to iOS I get this error:
ExecutionEngineException: Attempting to JIT compile method ‘System.Linq.OrderedEnumerable1<System.Collections.Generic.KeyValuePair2<string, Parse.ParseObject>>:GetEnumerator ()’ while running with --aot-only.
Generally speaking, iOS has the most troubles if you have a generic method/class with a value type parameter. So the whole linq library is a minefield of JIT compile errors. (Recently I used Enum.GetValues(typeof(T)).Cast().ToArray(), guess what, ToArray() did throw a JIT error because IEnumerable.ToArray() didn’t work for it although it works fine for a lot of other cases)
For the case OrderBy our company wrote our own extension method that is compatible with AoT.