Sample code for 30+ languages & platforms
Objective-C

Load StringTable from a StringBuilder

Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.

Chilkat Objective-C Downloads

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

BOOL success = NO;

CkoStringTable *strTab = [[CkoStringTable alloc] init];
CkoStringBuilder *sb = [[CkoStringBuilder alloc] init];

[sb Append: @"This is line 1\r\n"];
[sb Append: @"An empty line follows...\r\n"];
[sb Append: @"\r\n"];
[sb Append: @"This is line 4\r\n"];

[strTab AppendFromSb: sb];

int i = 0;
int numStrings = [strTab.Count intValue];
while (i < numStrings) {
    NSLog(@"%d%@%@",i,@": ",[strTab StringAt: [NSNumber numberWithInt: i]]);
    i = i + 1;
}