Ojbect-C     NSArray和NSMutableArray数组的使用   有关API查询

Adopted Protocols

NSCoding

  • encodeWithCoder:

  • initWithCoder:

NSCopying

  • copyWithZone:

NSMutableCopying

  • mutableCopyWithZone:

NSFastEnumeration

  • countByEnumeratingWithState:objects:count:

Tasks

Creating an Array

  • + array

  • + arrayWithArray:   --

  • + arrayWithContentsOfFile: --从文件中初始化数组

  • + arrayWithContentsOfURL:

  • + arrayWithObject:   --只能初始化一个元素

  • + arrayWithObjects: --初始化多个元素

  • + arrayWithObjects:count:

Initializing an Array

  • �C init

  • �C initWithArray:

  • �C initWithArray:copyItems:

  • �C initWithContentsOfFile:

  • �C initWithContentsOfURL:

  • �C initWithObjects:

  • �C initWithObjects:count:

Querying an Array

  • �C containsObject:   -- 是否包含字符串

  • �C count --获取元素中的个数

  • �C getObjects:range:

  • �C firstObject

  • �C lastObject

  • �C objectAtIndex:   --访问数组中的某个元素

  • �C objectAtIndexedSubscript:

  • �C objectsAtIndexes:

  • �C objectEnumerator

  • �C reverseObjectEnumerator

  • �C getObjects: Deprecated in OS X v10.6

Finding Objects in an Array

  • �C indexOfObject:

  • �C indexOfObject:inRange:

  • �C indexOfObjectIdenticalTo:

  • �C indexOfObjectIdenticalTo:inRange:

  • �C indexOfObjectPassingTest:

  • �C indexOfObjectWithOptions:passingTest:

  • �C indexOfObjectAtIndexes:options:passingTest:

  • �C indexesOfObjectsPassingTest:

  • �C indexesOfObjectsWithOptions:passingTest:

  • �C indexesOfObjectsAtIndexes:options:passingTest:

  • �C indexOfObject:inSortedRange:options:usingComparator:

Sending Messages to Elements

  • �C makeObjectsPerformSelector:

  • �C makeObjectsPerformSelector:withObject:

  • �C enumerateObjectsUsingBlock:

  • �C enumerateObjectsWithOptions:usingBlock:

  • �C enumerateObjectsAtIndexes:options:usingBlock:

Comparing Arrays

  • �C firstObjectCommonWithArray:

  • �C isEqualToArray:

Deriving New Arrays    

  • �C arrayByAddingObject:   --追加数组的内容

  • �C arrayByAddingObjectsFromArray:

  • �C filteredArrayUsingPredicate:

  • �C subarrayWithRange:

Sorting

  • �C sortedArrayHint

  • �C sortedArrayUsingFunction:context:

  • �C sortedArrayUsingFunction:context:hint:

  • �C sortedArrayUsingDescriptors:

  • �C sortedArrayUsingSelector:

  • �C sortedArrayUsingComparator:

  • �C sortedArrayWithOptions:usingComparator:

Working with String Elements

  • �C componentsJoinedByString:   --   数组-->字符串

Creating a Description

  • �C description

  • �C descriptionWithLocale:

  • �C descriptionWithLocale:indent:

  • �C writeToFile:atomically:

  • �C writeToURL:atomically:

Collecting Paths

  • �C pathsMatchingExtensions:

Key-Value Observing

  • �C addObserver:forKeyPath:options:context:

  • �C removeObserver:forKeyPath:

  • �C removeObserver:forKeyPath:context:

  • �C removeObserver:fromObjectsAtIndexes:forKeyPath:context:

  • �C addObserver:toObjectsAtIndexes:forKeyPath:options:context:

  • �C removeObserver:fromObjectsAtIndexes:forKeyPath:

Key-Value Coding

  • �C setValue:forKey:

  • �C valueForKey:







NSMutableArray


Tasks

Creating and Initializing a Mutable Array

  • + arrayWithCapacity:

  • �C initWithCapacity:

  • �C init

Adding Objects

  • �C addObject:

  • �C addObjectsFromArray:

  • �C insertObject:atIndex:

  • �C insertObjects:atIndexes:

Removing Objects

  • �C removeAllObjects

  • �C removeLastObject

  • �C removeObject:

  • �C removeObject:inRange:

  • �C removeObjectAtIndex:

  • �C removeObjectsAtIndexes:

  • �C removeObjectIdenticalTo:

  • �C removeObjectIdenticalTo:inRange:

  • �C removeObjectsInArray:

  • �C removeObjectsInRange:

  • �C removeObjectsFromIndices:numIndices: Deprecated in OS X v10.6

Replacing Objects

  • �C replaceObjectAtIndex:withObject:

  • �C setObject:atIndexedSubscript:

  • �C replaceObjectsAtIndexes:withObjects:

  • �C replaceObjectsInRange:withObjectsFromArray:range:

  • �C replaceObjectsInRange:withObjectsFromArray:

  • �C setArray:

Filtering Content

  • �C filterUsingPredicate:

Rearranging Content

  • �C exchangeObjectAtIndex:withObjectAtIndex:

  • �C sortUsingDescriptors:

  • �C sortUsingComparator:

  • �C sortWithOptions:usingComparator:

  • �C sortUsingFunction:context:

  • �C sortUsingSelector:


你可能感兴趣的:(数组,使用,NSArray,NSMutableArray)