I am trying to create an array similar to the one that is created like this:
NSData *jsonData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"www.example.com/j.php"]];
NSError *error = nil;
if (jsonData) {
result = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingMutableContainers
error:&error];
}
where www.example.com/j.php Is JSON that looks like this:
[{"name":"matt","genre":"Photography","info":"foo","date":"2014-06-12"},{"name":"jamie","genre":"Art","info":"Bar","date":"2014-06-13"}]
This array is then used like
result[indexPath.row][@"name"];
How can I build a new NSArray with my own name, genre and info that is in the same format as the one above??
I have tried to print the array using logs but it comes up as (null)
and I know I do not create it like this:
[NSArray arrayWithObjects: @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", nil]