Instance Method

enumerateObjectsWithOptions:usingBlock:

Executes a given block using each object in the set, using the specified enumeration options.

Declaration

- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(ObjectType obj, NSUInteger idx, BOOL *stop))block;

Parameters

opts

A bitmask that specifies the options for the enumeration (whether it should be performed concurrently and whether it should be performed in reverse order).

block

The block to apply to elements in the ordered set.

The block takes three arguments:

obj

The element in the set.

idx

The index of the item in the set.

stop

A reference to a Boolean value. The block can set the value to YES to stop further processing of the set. The stop argument is an out-only argument. You should only ever set this value to YES within the block.

The block returns a Boolean value that indicates whether obj passed the test.

See Also

Accessing Set Members

- containsObject:

Returns a Boolean value that indicates whether a given object is present in the ordered set.

- enumerateObjectsAtIndexes:options:usingBlock:

Executes a given block using the objects in the ordered set at the specified indexes.

- enumerateObjectsUsingBlock:

Executes a given block using each object in the ordered set.

firstObject

The first object in the ordered set.

lastObject

The last object in the ordered set.

- objectAtIndex:

Returns the object at the specified index of the set.

- objectAtIndexedSubscript:

Returns the object at the specified index of the set.

- objectsAtIndexes:

Returns the objects in the ordered set at the specified indexes.

- indexOfObject:

Returns the index of the specified object.

- indexOfObject:inSortedRange:options:usingComparator:

Returns the index, within a specified range, of an object compared with elements in the ordered set using a given NSComparator block.

- indexOfObjectAtIndexes:options:passingTest:

Returns the index, from a given set of indexes, of the object in the ordered set that passes a test in a given block for a given set of enumeration options.

- indexOfObjectPassingTest:

Returns the index of the object in the ordered set that passes a test in a given block.

- indexOfObjectWithOptions:passingTest:

Returns the index of an object in the ordered set that passes a test in a given block for a given set of enumeration options.

- indexesOfObjectsAtIndexes:options:passingTest:

Returns the index, from a given set of indexes, of the object in the ordered set that passes a test in a given block for a given set of enumeration options.

- indexesOfObjectsPassingTest:

Returns the index of the object in the ordered set that passes a test in a given block.

- indexesOfObjectsWithOptions:passingTest:

Returns the index of an object in the ordered set that passes a test in a given block for a given set of enumeration options.

- objectEnumerator

Returns an enumerator object that lets you access each object in the ordered set.

- reverseObjectEnumerator

Returns an enumerator object that lets you access each object in the ordered set.

reversedOrderedSet

An ordered set in the reverse order.

- getObjects:range:

Copies the objects contained in the ordered set that fall within the specified range to objects.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software