Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

NSIndexSpecifier Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSScriptObjectSpecifiers.h

Overview

The NSIndexSpecifier class represents an object in a collection (or container) with an index number. The script terms first and front specify the object with index 0, while last specifies the object with index of count-1. A negative index indicates a location by counting backward from the last object in the collection.

You don’t normally subclass NSIndexSpecifier.

Tasks

Creating Index Specifiers

Accessing the Index

Instance Methods

index

Returns the value receiver’s index property.

- (NSInteger)index

Return Value

Value of the receiver’s index property.

Availability
Declared In
NSScriptObjectSpecifiers.h

initWithContainerClassDescription:containerSpecifier:key:index:

Initializes an allocated NSIndexSpecifier object with a class description, container specifier, collection key, and object index.

- (id)initWithContainerClassDescription:(NSScriptClassDescription *)classDescription containerSpecifier:(NSScriptObjectSpecifier *)containerSpecifier key:(NSString *)collectionKey index:(NSInteger)objectIndex

Parameters
classDescription

Description for the container of the collection.

containerSpecifier

Container of the collection.

collectionKey

Name of the collection.

objectIndex

The object within the key collection the index specifier is to identify.

Return Value

Initialized NSIndexSpecifier object with its index property set to objectIndex.

Discussion

Invokes the super class’s initWithContainerClassDescription:containerSpecifier:key: method and sets the index property of the index specifier to objectIndex.

Availability
Declared In
NSScriptObjectSpecifiers.h

setIndex:

Sets the value of the receiver’s index property.

- (void)setIndex:(NSInteger)index

Parameters
index

Value for the receiver’s index property.

Availability
Declared In
NSScriptObjectSpecifiers.h

Next Page > Hide TOC


Last updated: 2007-04-01




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice