x


Support for Func and Action delegate on Iphone micro mscorlib?

Does iOS micro mscorlib support Func<T> and Action<T> delegates? This would be very important to know for a possible different implementation of HOTween.

I already checked the manual and the basic delegate functions seem to be supported on all stripping levels but Func<T> and Action<T> are not explicitly mentioned.

Unfortunately I don't have a Mac nor an Iphone Pro license so I would be grateful if someone could tell me :)

more ▼

asked Mar 31 '12 at 09:08 PM

stfx gravatar image

stfx
96 3 4 6

I don't know specifically, but I would guess that they're supported. Most of what's cut out is from System.dll -- you can see some more info on the distinction here.

I have noticed that iOS builds sometimes have trouble using enums in generics (especially when those generics rely on other generics). Not strictly related to your question, but seems worth a mention.

Apr 01 '12 at 01:13 AM rutter
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Found the location of the micro mscorlib:

Unity\Editor\Data\Mono\lib\mono\micro\mscorlib.dll

Action<T> is in that library but Func<T> is not (its in System.Core). A quick fix for that is to define the generic Func delegate yourself:

public delegate T Func<T>();

The only issue left is that Mono might have troubles building the full AOT for some generic classes (see Limitation: Generic Interface Instantiation). Maybe its even possible to test build your with --aot=full without Unity if you have the code in a separate dll but I didn't get this to work yet.

For more info about iOS limiations see monotouch limitations

Why isn't important stuff like that documented in the manual?

more ▼

answered Apr 02 '12 at 10:30 PM

stfx gravatar image

stfx
96 3 4 6

Good to know, that.

I've been frustrated a few times with topics like this. Unity has plenty of beginner-level documentation, but not much past that seems to be readily available.

Apr 03 '12 at 12:06 AM rutter
(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:

x2013
x40
x13
x12
x2

asked: Mar 31 '12 at 09:08 PM

Seen: 1053 times

Last Updated: Apr 03 '12 at 12:03 PM