Instance Method

enumerateObjects(_:)

Executes the specified block using each object in the fetch result, starting with the first object and continuing in order to the last object.

Declaration

func enumerateObjects(_ block: @escaping (ObjectType, Int, UnsafeMutablePointer<ObjCBool>) -> Void)

Parameters

block

The block to apply to elements in the fetch result.

The block takes three parameters:

obj

The element in the fetch result.

idx

The index of the element in the fetch result.

stop

A pointer to a Boolean value. Set *stop to true within the block to cancel further processing of the fetch result.

Discussion

This method executes synchronously.

See Also

Performing Operations with Objects in a Fetch Result

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