Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't understand what you mean in your point number 2 (if you have a variable collection of items you need to manage and a mutable array will do, just use a mutable array - ie, avoid premature optimization), but for the rest, it's pretty straightforward:</p> <p>See <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/Reference/Reference.html" rel="nofollow">NSMutableArray</a>. </p> <pre><code>NSMutableArray * televisions = [NSMutableArray array]; Television * thisTV = [[Television alloc] init]; [televisions addObject:thisTV]; [thisTV release]; // ... [[televisions objectAtIndex:0] setChannelNumber:34]; </code></pre> <p>Or <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html" rel="nofollow">NSMutableDictionary</a>.</p> <pre><code>NSMutableDictionary * televisionsByRoomName = [NSMutableDictionary dictionary]; Television * thisTV = [[Television alloc] init]; [televisionsByRoomName setObject:thisTV forKey:@"livingroom"]; [thisTV release]; // ... [[televisionsByRoomName objectForKey:@"livingroom"] setChannelNumber:34]; </code></pre> <p>All this and more can be yours for the low, low price of reading the <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Collections/Collections.html" rel="nofollow">Collections Programming Topics</a> which is referenced in a number of places in the introductory conceptual Cocoa documentation.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload