index(of:in:)
Returns the lowest index within the specified range whose corresponding object in the fetch result is equal to the specified object.
Declaration
func index(of anObject: ObjectType, in range: NSRange) -> IntParameters
- anObject:
An object.
- range:
The range of indexes in the fetch result within which to search for
anObject.
Return Value
The lowest index within range whose corresponding object in the fetch result is equal to anObject, or NSNotFound if no such object is in the fetch result.
Discussion
Starting at range.location, this method sends an == message to each object in the fetch result until it finds a match or reaches the end of the fetch result. This method passes the anObject parameter to each == message.
Raises a range exception if the range parameter represents a range that doesn’t exist in the fetch result.