-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.m
32 lines (27 loc) · 840 Bytes
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// main.m
//
// Copyright © 2018 BNotro Software Development Pty Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Reader.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
// make sure data.txt is included in project: Build Phases > Copy Files, (Resources), +add, uncheck 'copy only when installing'.
NSMutableArray * tables = [Reader loadFromTxtResource:@"data.txt"];
for (ReaderTable * table in tables)
{
for (ReaderRow * row in table.rows)
for (NSInteger i = 0, u = table.header.count-1; i <= u; i++)
{
NSObject * data = row.values[table.header[i]];
NSLog(@"%@: %@", table.header[i],data);
}
}
ReaderTable * atable = tables[0];
ReaderRow * arow= atable.rows[1];
NSString * value= arow.values[@"Type"];
NSLog(@"Hello, %@!", value);
}
return 0;
}