---
product: Chilkat
product_version: 11.7.0
language: objc
language_label: Objective-C
class: JsonArray
class_name: CkoJsonArray
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/objcCkoJsonArrayRef.html
---
# Chilkat JsonArray — Objective-C — v11.7.0

> Chilkat 11.7.0 · language=objc · class=JsonArray (CkoJsonArray)
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/JsonArray.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/guide.md`.

## Purpose

**Read, modify, search, and emit ordered JSON arrays.**

`Chilkat.JsonArray` is the JSON array companion to `Chilkat.JsonObject`. It represents an ordered list of JSON values and provides index-based methods for reading, inserting, replacing, deleting, swapping, searching, and emitting array data. It supports scalar values, nested objects, nested arrays, date/time parsing, exact numeric string handling, compact or pretty output, and search helpers for arrays of strings or arrays of objects.

**Ordered JSON values**

Work with JSON arrays as ordered lists containing strings, numbers, booleans, nulls, objects, arrays, and mixed value types.

**Index-based access**

Retrieve, insert, replace, delete, or swap values by array index when processing JSON list data.

**Nested objects and arrays**

Access child `JsonObject` and `JsonArray` values to navigate and modify deeper JSON structures.

**Search helpers**

Search arrays of strings or arrays of objects to locate matching values without manually scanning every element.

**Date and numeric handling**

Parse date/time values and preserve exact numeric strings when JSON data contains values that must not be rounded or reformatted.

**Emit JSON output**

Produce compact or pretty JSON output after array data has been loaded, edited, searched, or built programmatically.

**Common pattern:** Use `JsonObject` to navigate named members and JSON paths, then use `JsonArray` to iterate or modify ordered lists found within the object tree. Retrieve nested objects or arrays as needed, update values by index, and emit the final JSON in compact or pretty form.

For an extended overview, see [JsonArray Class Overview](https://www.chilkatsoft.com/jsonarray_class_overview.asp).

## Object creation, unlocking and error handling

**Object Creation**

```objectivec
CkoJsonArray *obj = [[CkoJsonArray alloc] init];
```

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in Objective-C.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `@property (nonatomic, copy) NSString *DebugLogFilePath;` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastErrorHtml` | `@property (nonatomic, readonly, copy) NSString *LastErrorHtml;` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `@property (nonatomic, readonly, copy) NSString *LastErrorText;` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `@property (nonatomic, readonly, copy) NSString *LastErrorXml;` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `@property (nonatomic) BOOL LastMethodSuccess;` | read/write | Indicates the success or failure of the most recent method call: `YES` means success, `NO` means failure. |
| `VerboseLogging` | `@property (nonatomic) BOOL VerboseLogging;` | read/write | If set to `YES`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `@property (nonatomic, readonly, copy) NSString *Version;` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `EmitCompact` | property, read/write | `@property (nonatomic) BOOL EmitCompact;` |
| `EmitCrlf` | property, read/write | `@property (nonatomic) BOOL EmitCrlf;` |
| `FindStartIndex` | property, read/write | `@property (nonatomic, copy) NSNumber *FindStartIndex;` |
| `Size` | property, read-only | `@property (nonatomic, readonly, copy) NSNumber *Size;` |
| `AddArrayAt` | method | `- (BOOL)AddArrayAt:(NSNumber *)index;` |
| `AddArrayAt2` | method | `- (BOOL)AddArrayAt2:(NSNumber *)index     jarr:(CkoJsonArray *)jarr;` |
| `AddBoolAt` | method | `- (BOOL)AddBoolAt:(NSNumber *)index     value:(BOOL)value;` |
| `AddIntAt` | method | `- (BOOL)AddIntAt:(NSNumber *)index     value:(NSNumber *)value;` |
| `AddNullAt` | method | `- (BOOL)AddNullAt:(NSNumber *)index;` |
| `AddNumberAt` | method | `- (BOOL)AddNumberAt:(NSNumber *)index     numericStr:(NSString *)numericStr;` |
| `AddObjectAt` | method | `- (BOOL)AddObjectAt:(NSNumber *)index;` |
| `AddObjectAt2` | method | `- (BOOL)AddObjectAt2:(NSNumber *)index     json:(CkoJsonObject *)json;` |
| `AddObjectCopyAt` | method | `- (BOOL)AddObjectCopyAt:(NSNumber *)index     jsonObj:(CkoJsonObject *)jsonObj;` |
| `AddStringAt` | method | `- (BOOL)AddStringAt:(NSNumber *)index     value:(NSString *)value;` |
| `AddUIntAt` | method | `- (BOOL)AddUIntAt:(NSNumber *)index     value:(NSNumber *)value;` |
| `AppendArrayItems` | method | `- (BOOL)AppendArrayItems:(CkoJsonArray *)jarr;` |
| `ArrayAt` | method | `- (CkoJsonArray *)ArrayAt:(NSNumber *)index;` |
| `ArrayAt2` | method | `- (BOOL)ArrayAt2:(NSNumber *)index     jarr:(CkoJsonArray *)jarr;` |
| `BoolAt` | method | `- (BOOL)BoolAt:(NSNumber *)index;` |
| `Clear` | method | `- (void)Clear;` |
| `DateAt` | method | `- (BOOL)DateAt:(NSNumber *)index     dateTime:(CkoDateTime *)dateTime;` |
| `DeleteAt` | method | `- (BOOL)DeleteAt:(NSNumber *)index;` |
| `DtAt` | method | `- (BOOL)DtAt:(NSNumber *)index     bLocal:(BOOL)bLocal     dt:(CkoDtObj *)dt;` |
| `Emit` | method | `- (NSString *)Emit;` |
| `EmitSb` | method | `- (BOOL)EmitSb:(CkoStringBuilder *)sb;` |
| `FindObject` | method | `- (NSNumber *)FindObject:(NSString *)name     value:(NSString *)value     caseSensitive:(BOOL)caseSensitive;` |
| `FindString` | method | `- (NSNumber *)FindString:(NSString *)value     caseSensitive:(BOOL)caseSensitive;` |
| `IntAt` | method | `- (NSNumber *)IntAt:(NSNumber *)index;` |
| `IsNullAt` | method | `- (BOOL)IsNullAt:(NSNumber *)index;` |
| `Load` | method | `- (BOOL)Load:(NSString *)jsonArray;` |
| `LoadSb` | method | `- (BOOL)LoadSb:(CkoStringBuilder *)sb;` |
| `ObjectAt` | method | `- (CkoJsonObject *)ObjectAt:(NSNumber *)index;` |
| `ObjectAt2` | method | `- (BOOL)ObjectAt2:(NSNumber *)index     jsonObj:(CkoJsonObject *)jsonObj;` |
| `SetBoolAt` | method | `- (BOOL)SetBoolAt:(NSNumber *)index     value:(BOOL)value;` |
| `SetIntAt` | method | `- (BOOL)SetIntAt:(NSNumber *)index     value:(NSNumber *)value;` |
| `SetNullAt` | method | `- (BOOL)SetNullAt:(NSNumber *)index;` |
| `SetNumberAt` | method | `- (BOOL)SetNumberAt:(NSNumber *)index     value:(NSString *)value;` |
| `SetStringAt` | method | `- (BOOL)SetStringAt:(NSNumber *)index     value:(NSString *)value;` |
| `SetUIntAt` | method | `- (BOOL)SetUIntAt:(NSNumber *)index     value:(NSNumber *)value;` |
| `StringAt` | method | `- (NSString *)StringAt:(NSNumber *)index;` |
| `Swap` | method | `- (BOOL)Swap:(NSNumber *)index1     index2:(NSNumber *)index2;` |
| `TypeAt` | method | `- (NSNumber *)TypeAt:(NSNumber *)index;` |
| `UIntAt` | method | `- (NSNumber *)UIntAt:(NSNumber *)index;` |

## Properties

### JsonArray.EmitCompact

`Chilkat 11.7.0 · objc · JsonArray · EmitCompact · property · read/write · since 9.5.0.64`

```objectivec
@property (nonatomic) BOOL EmitCompact;
```

Controls whether emitted JSON is compact or pretty-formatted. If `YES`, output contains no unnecessary whitespace and is emitted on a single line. If `NO`, indentation and line breaks are added for readability. The default is `YES`.

### JsonArray.EmitCrlf

`Chilkat 11.7.0 · objc · JsonArray · EmitCrlf · property · read/write · since 9.5.0.64`

```objectivec
@property (nonatomic) BOOL EmitCrlf;
```

Controls line endings when pretty-formatted JSON is emitted. If `YES`, line breaks use CRLF (); if `NO`, they use LF (). The default is `YES`.

**Applies only to pretty output:** When `EmitCompact` is `YES`, the JSON is emitted on one line and this setting has no effect.

### JsonArray.FindStartIndex

`Chilkat 11.7.0 · objc · JsonArray · FindStartIndex · property · read/write · since 11.6.0`

```objectivec
@property (nonatomic, copy) NSNumber *FindStartIndex;
```

Specifies the zero-based array index at which `FindString` and `FindObject` begin searching. The default value is `0`.

**Iterating matches:** After finding a match at index `n`, set this property to `n + 1` before the next search to continue with later elements.

### JsonArray.Size

`Chilkat 11.7.0 · objc · JsonArray · Size · property · read-only · since 9.5.0.56`

```objectivec
@property (nonatomic, readonly, copy) NSNumber *Size;
```

Returns the number of values currently contained in the JSON array. Array indexes therefore range from `0` through `Size - 1`.

## Methods

### JsonArray.AddArrayAt

`Chilkat 11.7.0 · objc · JsonArray · AddArrayAt · method · since 9.5.0.56`

```objectivec
- (BOOL)AddArrayAt:(NSNumber *)index;
```

Inserts a new, empty JSON array at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns YES for success, NO for failure.

### JsonArray.AddArrayAt2

`Chilkat 11.7.0 · objc · JsonArray · AddArrayAt2 · method · since 11.1.0`

```objectivec
- (BOOL)AddArrayAt2:(NSNumber *)index 
    jarr:(CkoJsonArray *)jarr;
```

Inserts a new, empty JSON array at zero-based position `index` and updates `jarr` to reference the newly inserted array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Immediate editing:** Because `jarr` references the inserted array, it can be populated directly without a separate `ArrayAt` lookup.

Returns YES for success, NO for failure.

### JsonArray.AddBoolAt

`Chilkat 11.7.0 · objc · JsonArray · AddBoolAt · method · since 9.5.0.56`

```objectivec
- (BOOL)AddBoolAt:(NSNumber *)index 
    value:(BOOL)value;
```

Inserts a new JSON boolean value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns YES for success, NO for failure.

### JsonArray.AddIntAt

`Chilkat 11.7.0 · objc · JsonArray · AddIntAt · method · since 9.5.0.56`

```objectivec
- (BOOL)AddIntAt:(NSNumber *)index 
    value:(NSNumber *)value;
```

Inserts a new JSON integer value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns YES for success, NO for failure.

### JsonArray.AddNullAt

`Chilkat 11.7.0 · objc · JsonArray · AddNullAt · method · since 9.5.0.56`

```objectivec
- (BOOL)AddNullAt:(NSNumber *)index;
```

Inserts a JSON `null` value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns YES for success, NO for failure.

### JsonArray.AddNumberAt

`Chilkat 11.7.0 · objc · JsonArray · AddNumberAt · method · since 9.5.0.56`

```objectivec
- (BOOL)AddNumberAt:(NSNumber *)index 
    numericStr:(NSString *)numericStr;
```

Inserts a JSON number at zero-based position `index`. The `numericStr` argument supplies the exact JSON numeric text to store. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Exact numeric text:** Use this method when lexical form or precision matters, for example `12345678901234567890`, `1.2500`, or scientific notation. The supplied text must be valid JSON number syntax; JSON does not permit `NaN` or infinity.

Returns YES for success, NO for failure.

### JsonArray.AddObjectAt

`Chilkat 11.7.0 · objc · JsonArray · AddObjectAt · method · since 9.5.0.56`

```objectivec
- (BOOL)AddObjectAt:(NSNumber *)index;
```

Inserts a new, empty JSON object at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns YES for success, NO for failure.

### JsonArray.AddObjectAt2

`Chilkat 11.7.0 · objc · JsonArray · AddObjectAt2 · method · since 11.1.0`

```objectivec
- (BOOL)AddObjectAt2:(NSNumber *)index 
    json:(CkoJsonObject *)json;
```

Inserts a new, empty JSON object at zero-based position `index` and updates `json` to reference the newly inserted object.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Immediate editing:** Because `json` references the inserted object, it can be populated directly without a separate `ObjectAt` lookup.

Returns YES for success, NO for failure.

### JsonArray.AddObjectCopyAt

`Chilkat 11.7.0 · objc · JsonArray · AddObjectCopyAt · method · since 9.5.0.82`

```objectivec
- (BOOL)AddObjectCopyAt:(NSNumber *)index 
    jsonObj:(CkoJsonObject *)jsonObj;
```

Inserts an independent copy of `jsonObj` at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Copy semantics:** The inserted object is copied rather than referenced. Later changes to the source `jsonObj` do not serve as edits to the inserted array value.

Returns YES for success, NO for failure.

### JsonArray.AddStringAt

`Chilkat 11.7.0 · objc · JsonArray · AddStringAt · method · since 9.5.0.56`

```objectivec
- (BOOL)AddStringAt:(NSNumber *)index 
    value:(NSString *)value;
```

Inserts a new JSON string value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns YES for success, NO for failure.

### JsonArray.AddUIntAt

`Chilkat 11.7.0 · objc · JsonArray · AddUIntAt · method · since 9.5.0.96`

```objectivec
- (BOOL)AddUIntAt:(NSNumber *)index 
    value:(NSNumber *)value;
```

Inserts a new JSON unsigned integer value at zero-based position `index`. Existing elements at that position and after it are shifted one position toward the end of the array.

|  |  |
| --- | --- |
| `0` | Insert as the first array element. |
| `-1` | Append as the last array element. |
| `n` | Insert at zero-based position n. |

**Insert vs. replace:** The `Add*At` methods insert a new array element. Use the corresponding `Set*At` method when replacing an existing element.

Returns YES for success, NO for failure.

### JsonArray.AppendArrayItems

`Chilkat 11.7.0 · objc · JsonArray · AppendArrayItems · method · since 9.5.0.82`

```objectivec
- (BOOL)AppendArrayItems:(CkoJsonArray *)jarr;
```

Appends copies of all values from `jarr` to the end of this array, preserving their order.

**Source is unchanged:** The source array is not emptied or moved. This method is useful for concatenating JSON arrays, including arrays belonging to different JSON documents.

Returns YES for success, NO for failure.

### JsonArray.ArrayAt

`Chilkat 11.7.0 · objc · JsonArray · ArrayAt · method · since 9.5.0.56`

```objectivec
- (CkoJsonArray *)ArrayAt:(NSNumber *)index;
```

Returns the nested JSON array stored at zero-based position `index`.

**Reference, not copy:** The returned `JsonArray` refers to the existing nested array in the same JSON document. Changes made through the returned object modify that nested array.

**Type requirement:** The value at `index` must be an array. Use `TypeAt` when the value type is not already known.

Returns `nil` on failure

### JsonArray.ArrayAt2

`Chilkat 11.7.0 · objc · JsonArray · ArrayAt2 · method · since 11.0.0`

```objectivec
- (BOOL)ArrayAt2:(NSNumber *)index 
    jarr:(CkoJsonArray *)jarr;
```

Updates `jarr` so that it references the nested JSON array stored at zero-based position `index`.

**Reference, not copy:** Changes made through `jarr` modify the existing nested array in the same JSON document.

Returns YES for success, NO for failure.

### JsonArray.BoolAt

`Chilkat 11.7.0 · objc · JsonArray · BoolAt · method · since 9.5.0.56`

```objectivec
- (BOOL)BoolAt:(NSNumber *)index;
```

Returns the boolean value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

### JsonArray.Clear

`Chilkat 11.7.0 · objc · JsonArray · Clear · method · since 9.5.0.76`

```objectivec
- (void)Clear;
```

Removes all values from the array, leaving an empty JSON array (`[]`).

### JsonArray.DateAt

`Chilkat 11.7.0 · objc · JsonArray · DateAt · method · since 9.5.0.73`

```objectivec
- (BOOL)DateAt:(NSNumber *)index 
    dateTime:(CkoDateTime *)dateTime;
```

Parses the date/time value at zero-based position `index` and loads the result into `dt`. Recognized forms include ISO 8601 timestamps (for example, `2009-11-04T19:55:41Z`), RFC 822-style date/time strings, and Unix timestamp integers.

**JSON has no native date type:** Dates are application conventions represented as strings or numbers. These methods recognize common representations and convert them to Chilkat date/time objects.

Returns YES for success, NO for failure.

### JsonArray.DeleteAt

`Chilkat 11.7.0 · objc · JsonArray · DeleteAt · method · since 9.5.0.56`

```objectivec
- (BOOL)DeleteAt:(NSNumber *)index;
```

Deletes the value at zero-based position `index`. Elements following the deleted value shift down by one position.

Returns YES for success, NO for failure.

### JsonArray.DtAt

`Chilkat 11.7.0 · objc · JsonArray · DtAt · method · since 9.5.0.73`

```objectivec
- (BOOL)DtAt:(NSNumber *)index 
    bLocal:(BOOL)bLocal 
    dt:(CkoDtObj *)dt;
```

Parses the date/time value at zero-based position `index` and loads the result into `dt`. If `bLocal` is `YES`, the populated fields represent local time; if `NO`, they represent UTC/GMT. Recognized forms include ISO 8601 timestamps, RFC 822-style date/time strings, and Unix timestamp integers.

**JSON has no native date type:** Dates are application conventions represented as strings or numbers. These methods recognize common representations and convert them to Chilkat date/time objects.

Returns YES for success, NO for failure.

### JsonArray.Emit

`Chilkat 11.7.0 · objc · JsonArray · Emit · method · since 9.5.0.58`

```objectivec
- (NSString *)Emit;
```

Serializes this JSON array and returns the resulting JSON text.

**Formatting:** Set `EmitCompact` to choose compact versus pretty output. When pretty output is enabled, `EmitCrlf` selects CRLF or LF line endings.

Returns `nil` on failure

### JsonArray.EmitSb

`Chilkat 11.7.0 · objc · JsonArray · EmitSb · method · since 9.5.0.65`

```objectivec
- (BOOL)EmitSb:(CkoStringBuilder *)sb;
```

Serializes this JSON array into the supplied `StringBuilder`.

**Formatting:** Set `EmitCompact` to choose compact versus pretty output. When pretty output is enabled, `EmitCrlf` selects CRLF or LF line endings.

**Large JSON:** Using a `StringBuilder` can avoid returning a very large JSON document as a language-native string before passing it to another Chilkat method or writing it to a file.

Returns YES for success, NO for failure.

### JsonArray.FindObject

`Chilkat 11.7.0 · objc · JsonArray · FindObject · method · since 9.5.0.73`

```objectivec
- (NSNumber *)FindObject:(NSString *)name 
    value:(NSString *)value 
    caseSensitive:(BOOL)caseSensitive;
```

Searches array elements that are JSON objects and returns the zero-based index of the first object whose direct member `name` has a value matching `value`. Returns `-1` if no match is found. The value pattern may contain `*`, which matches zero or more characters. Set `caseSensitive` to control whether letter case must match.

**Member name, not JSON path:** `name` identifies a direct member of each object being tested; it is not a JSON path.

**Search start:** Searching begins at `FindStartIndex`, whose default is `0`. To continue searching after a match, set `FindStartIndex` to the previous returned index plus 1.

### JsonArray.FindString

`Chilkat 11.7.0 · objc · JsonArray · FindString · method · since 9.5.0.73`

```objectivec
- (NSNumber *)FindString:(NSString *)value 
    caseSensitive:(BOOL)caseSensitive;
```

Searches for the first string array element matching `value` and returns its zero-based index, or `-1` if no match is found. The pattern may contain `*`, which matches zero or more characters. Set `caseSensitive` to control whether letter case must match.

**Search start:** Searching begins at `FindStartIndex`, whose default is `0`. To continue searching after a match, set `FindStartIndex` to the previous returned index plus 1.

### JsonArray.IntAt

`Chilkat 11.7.0 · objc · JsonArray · IntAt · method · since 9.5.0.56`

```objectivec
- (NSNumber *)IntAt:(NSNumber *)index;
```

Returns the integer value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

### JsonArray.IsNullAt

`Chilkat 11.7.0 · objc · JsonArray · IsNullAt · method · since 9.5.0.56`

```objectivec
- (BOOL)IsNullAt:(NSNumber *)index;
```

Returns `YES` if the value at zero-based position `index` is the JSON value `null`; otherwise returns `NO`.

**JSON null:** `null` is a distinct JSON value. It is not the same as an empty string, zero, `false`, an empty object, or an empty array.

### JsonArray.Load

`Chilkat 11.7.0 · objc · JsonArray · Load · method · since 9.5.0.64`

```objectivec
- (BOOL)Load:(NSString *)jsonArray;
```

Parses the JSON array text in `jsonArray` and loads it into this object. The input must represent a JSON array, beginning with `[` and ending with `]`.

**Important — loading detaches the array:** Calling this method makes the `JsonArray` its own independent JSON document. If the object previously referenced an array nested inside another JSON document, that relationship is discarded. For this reason, call `Load`/`LoadSb` on a new `JsonArray` instance.

Returns YES for success, NO for failure.

### JsonArray.LoadSb

`Chilkat 11.7.0 · objc · JsonArray · LoadSb · method · since 9.5.0.64`

```objectivec
- (BOOL)LoadSb:(CkoStringBuilder *)sb;
```

Parses the JSON array contained in `sb` and loads it into this object. The input must represent a JSON array, beginning with `[` and ending with `]`.

**Important — loading detaches the array:** Calling this method makes the `JsonArray` its own independent JSON document. If the object previously referenced an array nested inside another JSON document, that relationship is discarded. For this reason, call `Load`/`LoadSb` on a new `JsonArray` instance.

Returns YES for success, NO for failure.

### JsonArray.ObjectAt

`Chilkat 11.7.0 · objc · JsonArray · ObjectAt · method · since 9.5.0.56`

```objectivec
- (CkoJsonObject *)ObjectAt:(NSNumber *)index;
```

Returns the JSON object stored at zero-based position `index`.

**Reference, not copy:** The returned `JsonObject` refers to the existing object in the same JSON document. Changes made through the returned object modify that nested object.

**Type requirement:** The value at `index` must be an object. Use `TypeAt` when the value type is not already known.

Returns `nil` on failure

### JsonArray.ObjectAt2

`Chilkat 11.7.0 · objc · JsonArray · ObjectAt2 · method · since 11.0.0`

```objectivec
- (BOOL)ObjectAt2:(NSNumber *)index 
    jsonObj:(CkoJsonObject *)jsonObj;
```

Updates `jsonObj` so that it references the JSON object stored at zero-based position `index`.

**Reference, not copy:** Changes made through `jsonObj` modify the existing object in the same JSON document.

Returns YES for success, NO for failure.

### JsonArray.SetBoolAt

`Chilkat 11.7.0 · objc · JsonArray · SetBoolAt · method · since 9.5.0.56`

```objectivec
- (BOOL)SetBoolAt:(NSNumber *)index 
    value:(BOOL)value;
```

Replaces the value at zero-based position `index` with the specified JSON boolean value. The array length and the positions of other elements are unchanged.

Returns YES for success, NO for failure.

### JsonArray.SetIntAt

`Chilkat 11.7.0 · objc · JsonArray · SetIntAt · method · since 9.5.0.56`

```objectivec
- (BOOL)SetIntAt:(NSNumber *)index 
    value:(NSNumber *)value;
```

Replaces the value at zero-based position `index` with the specified JSON integer value. The array length and the positions of other elements are unchanged.

Returns YES for success, NO for failure.

### JsonArray.SetNullAt

`Chilkat 11.7.0 · objc · JsonArray · SetNullAt · method · since 9.5.0.56`

```objectivec
- (BOOL)SetNullAt:(NSNumber *)index;
```

Replaces the value at zero-based position `index` with the JSON value `null`. The array length and the positions of other elements are unchanged.

Returns YES for success, NO for failure.

### JsonArray.SetNumberAt

`Chilkat 11.7.0 · objc · JsonArray · SetNumberAt · method · since 9.5.0.56`

```objectivec
- (BOOL)SetNumberAt:(NSNumber *)index 
    value:(NSString *)value;
```

Replaces the value at zero-based position `index` with a JSON number. The `value` argument supplies the exact JSON numeric text to store.

**Exact numeric text:** Use this method when lexical form or precision matters. The supplied text must be valid JSON number syntax; JSON does not permit `NaN` or infinity.

Returns YES for success, NO for failure.

### JsonArray.SetStringAt

`Chilkat 11.7.0 · objc · JsonArray · SetStringAt · method · since 9.5.0.56`

```objectivec
- (BOOL)SetStringAt:(NSNumber *)index 
    value:(NSString *)value;
```

Replaces the value at zero-based position `index` with the specified JSON string value. The array length and the positions of other elements are unchanged.

Returns YES for success, NO for failure.

### JsonArray.SetUIntAt

`Chilkat 11.7.0 · objc · JsonArray · SetUIntAt · method · since 9.5.0.96`

```objectivec
- (BOOL)SetUIntAt:(NSNumber *)index 
    value:(NSNumber *)value;
```

Replaces the value at zero-based position `index` with the specified JSON unsigned integer value. The array length and the positions of other elements are unchanged.

Returns YES for success, NO for failure.

### JsonArray.StringAt

`Chilkat 11.7.0 · objc · JsonArray · StringAt · method · since 9.5.0.56`

```objectivec
- (NSString *)StringAt:(NSNumber *)index;
```

Returns the string value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

Returns `nil` on failure

### JsonArray.Swap

`Chilkat 11.7.0 · objc · JsonArray · Swap · method · since 9.5.0.76`

```objectivec
- (BOOL)Swap:(NSNumber *)index1 
    index2:(NSNumber *)index2;
```

Exchanges the values at zero-based positions `index1` and `index2`. The array length does not change.

Returns YES for success, NO for failure.

### JsonArray.TypeAt

`Chilkat 11.7.0 · objc · JsonArray · TypeAt · method · since 9.5.0.58`

```objectivec
- (NSNumber *)TypeAt:(NSNumber *)index;
```

Returns an integer identifying the JSON type of the value at zero-based position `index`. Returns `-1` if no value exists at that index.

|  |  |
| --- | --- |
| `1` | string |
| `2` | number |
| `3` | object |
| `4` | array |
| `5` | boolean |
| `6` | null |

**Why use TypeAt:** JSON arrays may contain mixed types. Checking the type first avoids choosing a type-specific accessor such as `ObjectAt`, `ArrayAt`, or `IntAt` for the wrong kind of value.

### JsonArray.UIntAt

`Chilkat 11.7.0 · objc · JsonArray · UIntAt · method · since 9.5.0.96`

```objectivec
- (NSNumber *)UIntAt:(NSNumber *)index;
```

Returns the unsigned integer value stored at zero-based position `index`.

**Type-aware access:** Use `TypeAt` when the JSON type at `index` is not already known.

## Related classes

[`CkDateTime`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/classes/CkDateTime.md), [`DtObj`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/classes/DtObj.md), [`JsonObject`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/classes/JsonObject.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/objc/classes/StringBuilder.md)

