Structure

NSRange

A structure used to describe a portion of a series, such as characters in a string or objects in an array.

Declaration

typedef struct _NSRange {
    ...
} NSRange;

Overview

Topics

Managing Ranges

NSEqualRanges

Returns a Boolean value that indicates whether two given ranges are equal.

NSIntersectionRange

Returns the intersection of the specified ranges.

NSLocationInRange

Returns a Boolean value that indicates whether a specified position is in a given range.

NSMakeRange

Creates a new NSRange from the specified values.

NSMaxRange

Returns the sum of the location and length of the range.

NSRangeFromString

Returns a range from a textual representation.

NSStringFromRange

Returns a string representation of a range.

NSUnionRange

Returns the union of the specified ranges.

Related Types

NSRangePointer

Type indicating a parameter is a pointer to an NSRange structure.

NSNotFound

A value indicating that a requested item couldn’t be found or doesn’t exist.

Instance Properties

length

The number of items in the range (can be 0). For type compatibility with the rest of the system, LONG_MAX is the maximum value you should use for length.

location

The start index (0 is the first, as in C arrays). For type compatibility with the rest of the system, LONG_MAX is the maximum value you should use for location.