Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:33:33+00:00 2026-05-23T21:33:33+00:00

after 2 Weeks of Developement i first tried my app on the iphone and

  • 0

after 2 Weeks of Developement i first tried my app on the iphone and it crashes at the following line (which works perfectly in the simulator):

i have the following code:

private readonly Dictionary<string, QueueItem queued = new Dictionary<string, QueueItem>();

private void Processqueue()
{
    KeyValuePair<string, QueueItem> valuePair = queued.FirstOrDefault();
    // Crashes with: System.TypeInitializationException has been thrown
    // "And exception was thrown by the type initializer for PredicateOf`1"
}

private class QueueItem
{
   public string Url { get; set; }
   public Action<string> ImageLoaded { get; set; }
   public bool Pending { get; set; }
}

Hope that someone has an idea what to do.

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:33:34+00:00Added an answer on May 23, 2026 at 9:33 pm

    Somehow the AOT compiler could not detect this case so yes you should file a bug report about it. In the mean time you can workaround this by doing:

    KeyValuePair<string, QueueItem> valuePair = queued.FirstOrDefault (delegate { return true; });
    

    which will avoid reaching PredicateOf while doing the exact same thing (execution wise) and a bit shorter than looping yourself.

    Also you got a TypeLoadException because the original exception occurred in a static constructor (which always results in a TLE, the inner exception should be the one you expected to see).

    UPDATE: This was filed as bug #300 and fixed in recent releases of MonoTouch (4.2+)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A couple of weeks ago i have started my research in Iphone app development
I get the following errors which is a slight improvement after taking weeks (very
Hey I have tried a lot creating spree extension , but after weeks efforts
I have pretty much finished my first WPF project after several weeks. Now I
After weeks of effort I have managed to write F# programs that use LLVM
Sorry for my inpatience but after weeks staying up late and just having put
I'm using Eclipse Galileo (v3.51). All of a sudden, after weeks of it starting
After few weeks break, I'm trying to expand and extend my knowlege of templates
After spending three weeks learning Objective-C and Cocoa programming for my work, I've been
I want to find a date after a give weeks(months). For example, I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.