Ojbect-C2 5、NSSet和NSMutableSet集合的使用

Adopted Protocols

NSCoding
  • encodeWithCoder:

  • initWithCoder:

NSCopying
  • copyWithZone:

NSMutableCopying
  • mutableCopyWithZone:

NSFastEnumeration
  • countByEnumeratingWithState:objects:count:

Tasks

Creating a Set

  • + set
  • + setWithArray:
  • + setWithObject:
  • + setWithObjects:
  • + setWithObjects:count:
  • + setWithSet:
  • – setByAddingObject:
  • – setByAddingObjectsFromSet:
  • – setByAddingObjectsFromArray:

Initializing a Set

  • – initWithArray:
  • – initWithObjects:
  • – initWithObjects:count:
  • – initWithSet:
  • – initWithSet:copyItems:
  • – init

Counting Entries

  • – count

Accessing Set Members

  • – allObjects
  • – anyObject
  • – containsObject:
  • – filteredSetUsingPredicate:
  • – makeObjectsPerformSelector:
  • – makeObjectsPerformSelector:withObject:
  • – member:
  • – objectEnumerator
  • – enumerateObjectsUsingBlock:
  • – enumerateObjectsWithOptions:usingBlock:
  • – objectsPassingTest:
  • – objectsWithOptions:passingTest:

Comparing Sets

  • – isSubsetOfSet:
  • – intersectsSet:
  • – isEqualToSet:
  • – valueForKey:
  • – setValue:forKey:

Creating a Sorted Array

  • – sortedArrayUsingDescriptors:

Key-Value Observing

  • – addObserver:forKeyPath:options:context:
  • – removeObserver:forKeyPath:context:
  • – removeObserver:forKeyPath:

Describing a Set

  • – description
  • – descriptionWithLocale:








NSMutableSet


Tasks

Creating a Mutable Set

  • + setWithCapacity:
  • – initWithCapacity:
  • – init

Adding and Removing Entries

  • – addObject:
  • – filterUsingPredicate:
  • – removeObject:
  • – removeAllObjects
  • – addObjectsFromArray:

Combining and Recombining Sets

  • – unionSet:
  • – minusSet:
  • – intersectSet:
  • – setSet:





你可能感兴趣的:(Ojbect-C2 5、NSSet和NSMutableSet集合的使用)