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

  • Home
  • SEARCH
  • 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 9129051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:39:31+00:00 2026-06-17T07:39:31+00:00

It says that using value types as dictionary keys will crashes and burns rather

  • 0

It says that using value types as dictionary keys will “crashes and burns rather quickly on the device”, does that means I can’t use something like Dictionary<int, string> to make a string lookup table?

  • 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-06-17T07:39:32+00:00Added an answer on June 17, 2026 at 7:39 am

    It says that using value types as dictionary keys will “crashes and burns rather quickly on the device”,

    It’s not so dramatic (no burn) or so automatic – but it can happen.

    Apple does not allow JIT (just in time) compilation on devices. This means that everything must be pre-compiled (ahead of time) before being deployed to devices. This means a few limitations exists for MonoTouch that you would not have with .NET / Mono or Mono for Android.

    In general the generated code for generics can be shared between different types. Sadly this is not possible for value types. This means the AOT (ahead of time) compiler must generate code for every value type being used.

    In some cases the AOT compiler might not be able to detect every possible type that might be needed at runtime. This will cause an EngineExecutionException that will point you to the offending code.

    At this stage you can try to:

    • hint the AOT compiler that the code is needed (i.e. add some code that will make the AOT compiler generates the required missing code); or

    • refactor the code, e.g. to avoid value types;

    does that means I can’t use something like Dictionary to make a string lookup table?

    No, that will work. When you create an instance of Dictionary<int, string> then it’s pretty straightforward for the AOT compiler to know what code needs to be generated.

    Problems generally occurs when nesting generics or when using code that does (e.g. LINQ queries with value types can generate such code).

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

Sidebar

Related Questions

says if i develop a Ruby on Rails application using Rails 2.3.2, will that
The MSDN says that using ReadDirectoryChangesW implies the calling process having the Backup and
I was reading today about OOCSS which says by using that approach have 2
Part of the GUI I'm building using tkinter has a pop-up window that says
MSDN says that public static members of System.Windows.Application are thread safe. But when I
It says that if there is a virtual function, it is a good practice
Official appengine documentation says that if we set threadsafe property to true in app.yaml
Haskell 98 specification says that the entry point of a program, namely, function main
Here it says that I can get width (of columns I guess) but only
The play documentation says that « By default, [the Assets] controller provides caching, ETag,

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.