x


C# on iPhone unable to access Mono 2.6 features

The release notes for iPhone 1.6 said Mono was updated to Mono 2.6. However, none of the C# 3 features that are part of Mono 2.6 such as var are compiling. Is Unity iPhone specifically setting a compile flag to force .NET 2.1 only features? Is this necessary for Full AOT compilation? We can get C# 3 features in regular Unity with this hack but I'm not sure what to do for iPhone since the compiler looks to already be updated to 2.6 and there's no 3.0 option in the project's player settings.

If I have to just wait for Unity 3 I suppose that's acceptable, but considering iPhone apps don't depend on any sort of backwards compatibility and Mono has already been upgraded, it would be really nice to have the latest and greatest language features.

more ▼

asked May 25, 2010 at 01:22 AM

dkoontz gravatar image

dkoontz
181 24 20 34

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

Support for some C# 3.0 features will come to Unity iPhone, but most likely some time after Unity 3.0.

more ▼

answered May 27, 2010 at 09:47 AM

Mantas Puida gravatar image

Mantas Puida
981 2 7 15

(comments are locked)
10|3000 characters needed characters left

what i am writing is just a guess. mono is a runtime with libraries and unity updated it's use of mono so you can compile things like dynamic language runtime for it and some other features but unity don't use the JIT compiler that mono has and wrote a ahead of time compiler. this compiler needs to be updated to support c# 3 features.

more ▼

answered May 25, 2010 at 02:27 AM

Ashkan_gc gravatar image

Ashkan_gc
10.1k 77 104 165

But the AOT compiler is part of the mono compiler toolchain, there's an AOT flag (--aot) you can pass in to get AOT compilation. I understand that "Full AOT" is a bit more involved and requires perhaps picking and choosing how the Mono runtime is integrated into the execution environment and perhaps that is where the problem is.

May 26, 2010 at 12:50 AM dkoontz

-AOT is an option for compiling normal apps and it's what the jit do at runtime but iphone's AOT compiler has differences. i am not sure what are the differences exactly. i don't know if unity's mono compiler for the iphone has any relations with mono touch or not but i think you can send this question to support and they'll answer it or just tell some users to vote it up and then staff will notice it.

May 26, 2010 at 09:40 AM Ashkan_gc
(comments are locked)
10|3000 characters needed characters left

You don't need that hack in Unity3 to use c# 3.0 features in the editor. Which specific piece of code is not working for you on the iphone? Please also make sure to disable all stripping.

(We allow agressive stripping, which at its strongest level removes quite a lot of mono functionality. Those levels are really intended for the "I dont care about this .NET stuff, I just want to make my dragon walk forward kthnxbyt" scenario)

more ▼

answered Oct 05, 2010 at 03:18 PM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
9k 32 75 118

Things seem to be working fine in Unity 3. My issue was with old iPhone 1.x after the Mono 2.6 update.

Oct 05, 2010 at 08:20 PM dkoontz
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2228
x250

asked: May 25, 2010 at 01:22 AM

Seen: 2357 times

Last Updated: May 25, 2010 at 01:22 AM