# CCPointArray Class Reference

Inherits from | NSObject
Conforms to | NSCopying
Declared in | CCActionCatmullRom.h

## Overview

A simple array that is used to contain the spline control points.

## Tasks

### Other Methods

- `controlPoints` property
- `+ arrayWithCapacity:`
- `– initWithCapacity:`

### Point Array Management

- `– addControlPoint:`
- `– insertControlPoint:atIndex:`
- `– replaceControlPoint:atIndex:`
- `– getControlPointAtIndex:`
- `– removeControlPointAtIndex:`
- `– count`
- `– reverse`
- `– reverseInline`

## Properties

### controlPoints

Array that contains the control points.

`@property (nonatomic, readwrite, strong) NSMutableArray *controlPoints`

#### Declared In

`CCActionCatmullRom.h`

## Class Methods

### arrayWithCapacity:

Creates and initializes a Points array with capacity.

`+ (id)arrayWithCapacity:(NSUInteger)capacity`

#### Parameters

capacity

  Capacity of the array.

#### Return Value

New point array.

#### Declared In

`CCActionCatmullRom.h`

## Instance Methods

### addControlPoint:

Appends a control point.

`- (void)addControlPoint:(CGPoint)controlPoint`

#### Parameters

controlPoint

  Control point to append.

#### Declared In

`CCActionCatmullRom.h`

### count

Returns the number of control points in the array.

`- (NSUInteger)count`

#### Return Value

Number of control points.

#### Declared In

`CCActionCatmullRom.h`

### getControlPointAtIndex:

Retrieves a control point.

`- (CGPoint)getControlPointAtIndex:(NSInteger)index`

#### Parameters

index

  Index of control point to retrieve.

#### Return Value

A control point.

#### Declared In

`CCActionCatmullRom.h`

### initWithCapacity:

Initializes a Points array with capacity.

`- (id)initWithCapacity:(NSUInteger)capacity`

#### Parameters

capacity

  Capacity of the array.

#### Return Value

New point array.

#### Declared In

`CCActionCatmullRom.h`

### insertControlPoint:atIndex:

Inserts a controlPoint.

`- (void)insertControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index`

#### Parameters

controlPoint

  Control point to insert.

index

  Index of point.

#### Declared In

`CCActionCatmullRom.h`

### removeControlPointAtIndex:

Deletes a control point.

`- (void)removeControlPointAtIndex:(NSUInteger)index`

#### Parameters

index

  Index of control point to delete.

#### Declared In

`CCActionCatmullRom.h`

### replaceControlPoint:atIndex:

Replaces an existing control point.

`- (void)replaceControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index`

#### Parameters

controlPoint

  New control point.

index

  Index of point to replace.

#### Declared In

`CCActionCatmullRom.h`

### reverse

Creates a new copy of the array, in reversed order. User is responsible for releasing this array.

`- (CCPointArray *)reverse`

#### Return Value

New point array.

#### Declared In

`CCActionCatmullRom.h`

### reverseInline

Reverses the current control point array.

`- (void)reverseInline`

#### Declared In

`CCActionCatmullRom.h`