Sample code for 30+ languages & platforms
Objective-C

JSON Append String Array

See more JSON Examples

Demonstrates how to append an array of strings from a string table object.

Note: This example uses the AppendStringTable method, which was introduced in Chilkat v9.5.0.67

Chilkat Objective-C Downloads

Objective-C
#import <CkoJsonObject.h>
#import <CkoStringTable.h>

CkoJsonObject *json = [[CkoJsonObject alloc] init];
json.EmitCompact = NO;

[json AppendString: @"abc" value: @"123"];

CkoStringTable *st = [[CkoStringTable alloc] init];
[st Append: @"a"];
[st Append: @"b"];
[st Append: @"c"];
[st Append: @"d"];

[json AppendStringArray: @"strArray" values: st];

NSLog(@"%@",[json Emit]);

//  Output:

//  	{
//  	  "abc": "123",
//  	  "strArray": [
//  	    "a",
//  	    "b",
//  	    "c",
//  	    "d"
//  	  ]
//  	}