Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Foundation Collections by Kevin Conner

Foundation Collections by Kevin Conner

Kevin discusses the various collection classes available to Mac and iOS developers as part of Foundation at CocoaHeads August in Raleigh

Triangle Cocoa

August 23, 2012
Tweet

More Decks by Triangle Cocoa

Other Decks in Programming

Transcript

  1. New syntax • array[i] • dictionary[k] • @[larry, moe, curly]

    • @{ key: value, foo: bar } • @3, @YES, @(array.count - 1)
  2. Sets can be indexes for other collections • NSSet :

    NSDictionary :: NSIndexSet : NSArray • [dictionary keySet] • [NSIndexSet indexSetWithRange: • NSMakeRange(0, array.count)]
  3. "An object can be put into the same pool several

    times, in which case it receives a release message for each time it was put into the pool."
  4. NSArray and NSOrderedSet • -objectAtIndex: • -indexOfObject: • -insertObject:atIndex: •

    -removeObjectAtIndex: • -exchangeObjectAtIndex:withObjectAtIndex: