Instance Method

objectAtIndexedSubscript:

Returns the goal at the specified index in the behavior’s list of goals.

Declaration

- (GKGoal *)objectAtIndexedSubscript:(NSUInteger)idx;

Parameters

idx

An index in the behavior’s list of goals; must be less than the value of the goalCount property.

Return Value

The goal at the specified index.

Discussion

The order of goals in a behavior is undefined. However, you can use this method to enumerate all goals in a behavior.

See Also

Working with Goals Using Subscript Syntax

- objectForKeyedSubscript:

Returns the weight associated with the goal specified by subscript syntax.

- setObject:forKeyedSubscript:

Sets the weight for the goal specified by subscript syntax.