Instance Method

setValue:atIndex:

Sets the value at the specified numeric index in the JavaScript object value.

Declaration

- (void)setValue:(id)value atIndex:(NSUInteger)index;

Parameters

value

The value to set at the specified index.

index

An index in the JavaScript object.

Discussion

Calling this method is equivalent to using the subscript operator with a numeric subscript in JavaScript. Use it to access elements of JavaScript arrays or of objects with numerically-indexed properties.

See Also

Working with Container Values

- defineProperty:descriptor:

Defines a property on the JavaScript object value or modifies a property’s definition.

- hasProperty:

Returns a Boolean value indicating whether the JavaScript value has a defined property with the specified name.

- deleteProperty:

Deletes the named property from the JavaScript object value.

- valueAtIndex:

Returns the value at the specified numeric index in the JavaScript object value.

- valueForProperty:

Returns the value of the named property in the JavaScript object value.

- setValue:forProperty:

Sets the value of the named property in the JavaScript object value.