quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

NSScreencast Episode #72 Objective-C Collections

Objective-C Collections - NSScreencast

主にNSSetの説明

  • NSSet, NSArray, NSOrderedSet, and NSDictionary
  • NSArray
    • [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
      • idx がある
      • (*stop) = YES; で止める(break)
    • (BOOL) containsObject
    • performance -> liner (array is fast to append top or tail)
  • NSSet
    • better performance (constant time for insert /removal)
    • no order, unique
    • containObject
    • NSMurableSet
      • minusSet:NSSet*
  • classのenum
    • isEqual の実装
      • [object isKindOfClass:[Person class]]
    • hash の実装
      • return [self.name hash];
  • NSOrderedSet, NSMutableOrderedSet
  • NSCountedSet