[MonoTouch] Exception: JIT Compile

Robert Jordan robertj at gmx.net
Fri Dec 9 13:20:17 EST 2011


On 09.12.2011 16:27, Mittchel debaass wrote:
> Hello everyone,
>
> Recently I converted Twitterizer to MonoTouch and tested it on the
> emulator. This worked fine, though when I am testing it on the device it
> goes terribly wrong.
> I am getting two JIT Compile errors in 2 different method, the code can be
> found here: http://pastebin.com/05hcLBRH
>
> What's going wrong? why does it work in the emulator and fails it badly on
> the device?

It due to this limitation:

http://docs.xamarin.com/ios/about/limitations#Value_types_as_Dictionary_Keys

Even you don't use dictionaries directly, Linq might still need an
IEqualityComparer<TKey> for a value type TKey.

Try to rewrite Linq query, especially the orderby clause:

var paramsSorted = from p in parameters
                                orderby p.Key, p.Value
                                select p;

Robert



More information about the MonoTouch mailing list