---
title: NSIndexSpecifier
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsindexspecifier
---

# NSIndexSpecifier

A specifier representing an object in a collection (or container) with an index number.

## Declaration

```swift
class NSIndexSpecifier
```

## Overview

Overview 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.

## Topics

### Creating Index Specifiers

- [init(containerClassDescription:containerSpecifier:key:index:)](foundation/nsindexspecifier/init(containerclassdescription:containerspecifier:key:index:).md)

### Accessing the Index

- [index](foundation/nsindexspecifier/index.md)

## Relationships

### Inherits From

- [NSScriptObjectSpecifier](foundation/nsscriptobjectspecifier.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Object Specifiers

- [NSScriptObjectSpecifier](foundation/nsscriptobjectspecifier.md)
- [NSPropertySpecifier](foundation/nspropertyspecifier.md)
- [NSPositionalSpecifier](foundation/nspositionalspecifier.md)
- [NSRandomSpecifier](foundation/nsrandomspecifier.md)
- [NSRangeSpecifier](foundation/nsrangespecifier.md)
- [NSUniqueIDSpecifier](foundation/nsuniqueidspecifier.md)
- [NSWhoseSpecifier](foundation/nswhosespecifier.md)
- [NSNameSpecifier](foundation/nsnamespecifier.md)
- [NSMiddleSpecifier](foundation/nsmiddlespecifier.md)
- [NSRelativeSpecifier](foundation/nsrelativespecifier.md)
