1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

How do We Express an Array or Collections of Objects?

Discussion in 'iPhone/iPad Programming' started by teguh123, Mar 31, 2011.

  1. macrumors member


    Is there a better class?

    For example, in vb.net 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. macrumors newbie

    What do you mean by a "better" way?

    In Objective-C, we use NSArray class to create arrays.
  3. macrumors 603

  4. macrumors Pentium


    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".
  5. Sykte, Apr 1, 2011
    Last edited: Apr 2, 2011

    macrumors regular

    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