How do We Express an Array or Collections of Objects?

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

  1. macrumors member

    Joined:
    Mar 22, 2011
    #1
    NSArray?

    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

    Joined:
    Mar 31, 2011
    #2
    What do you mean by a "better" way?

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

    Joined:
    Aug 9, 2009
  4. macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #4
    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

    Joined:
    Aug 26, 2010
    #5
    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