- Home /
List<> class in iOS (C#)
Is it possible to use the List<> class in iOS?
What I want to do is have a List that gameObjects are added to and removed from at runtime.
Afaik such a thing can only be done through Lists.
If the use of Lists is not possible in iOS, how would I do such a thing?
With ArrayLists maybe? I've read in more than one places that they should be avoided.
Answer by Mike 3 · Jan 18, 2011 at 10:28 PM
You can use List just fine on iOS, in both c# and js.
You need using System.Collections.Generic; for c# and import System.Collections.Generic; for js, at the top of the file.
For js, you'll need to use List. instead of List like c#
Thanks $$anonymous$$ike. I've read that Generics are not supported at all on iPhone, because it runs on an earlier version of $$anonymous$$ono. Is this info outdated? You're saying that I can create a List from inside a js?
Here's where I've read it: http://robotduck.wordpress.com/2009/11/04/88/
That was from 2009, we've come a long way since unity iphone 1.5 or so - can use list with both c# (since, uh, unity iphone 1.6?) and js (since 3.0)
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Add to generic list on start problem 1 Answer
Arraylist vs List,Arraylist vs list 2 Answers
Lists (C#) 2 Answers
What do you think of this? List, Vector 3 and Update 1 Answer