How do We Express an Array or Collections of Objects?

Discussion in 'iOS Programming' started by teguh123, Mar 31, 2011.

  1. teguh123
    Expand Collapse
    macrumors member

    Mar 22, 2011

    Is there a better class?

    For example, in I have generic.list(of SomeClass), which I believe is better than just SomeClass(). However both are easily interchangeable due to linq .toList and .toArray function.
  2. Nayefc
    Expand Collapse
    macrumors newbie

    Mar 31, 2011
    What do you mean by a "better" way?

    In Objective-C, we use NSArray class to create arrays.
  3. KnightWRX
    Expand Collapse
    macrumors Pentium


    Jan 28, 2009
    Quebec, Canada
    What are you trying to accomplish exactly ? Maybe if you grounded your question in something more tangible than comparing languages, we could help you with the NeXTSTEP/Cocoa Touch/Objective-C answer.

    As it stands, NSArray or NSMutableArray are it for "lists of objects".
  4. Sykte, Apr 1, 2011
    Last edited: Apr 2, 2011

    Expand Collapse
    macrumors regular

    Aug 26, 2010
    NSArray & NSMutableArray holds objects not data types so unlike VB its does not require multiple array types.

    In VB you define a generic to hold multiple data types at one time otherwise a list would be restricted to only one type at a time ie: string, int, custom object.

Share This Page