- Home /
What is better on iPhone: ArrayList or List<T>?
hey there!
I wonder what is better to use on iPhone: ArrayList or List?
Thnx!
Listen to Statement. But List is better everywhere; it's not specific to a platform.
Yeah it feels ArrayList is obsolete and have no real place left in place of generic List T
Answer by Statement · Mar 25, 2011 at 02:53 PM
If you're using List you won't have to cast objects since it's generic and use a T[] backing storage (at least .net does this). ArrayList have to cast everything to object and cause boxing with value types.
So, use List.
Also, another reason to use List over ArrayList - the enumerator used in List is just plain faster. They couldn't change it when they went to generics due to backwards compatability, so you're left with a much slower implementation there
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Combine Children Dictionary in place of Hashtable? 2 Answers
How to find IndexOf vector3 List ? position search 2 Answers
Arraylist vs List,Arraylist vs list 2 Answers
Lists (C#) 2 Answers