I am trying to feed in some JSON data to my iPhone app, the data is coming in fine as I have NSLog's telling me so.

The problem I am having is trying to get the results to show in a UITableView. I have a navigation controller underneath a tab bar controller, the navigation controller contains a table view controller which loads another NIB file with a table view connected to a class which is the delegate and data source delegate.

I also need to categorize the results into sections - these being

* England
* Scotland
* Wales
* N.Ireland

To get an idea of what JSON string I am using [see this one](http://www.thebigfishexperience.org.uk/sources/ajax/venue-json.php?location=peterborough).

As you can see the JSON does not cater for the sections but I am yet to implement this, so i would need to know beforehand so I do not have to amend much code later on.

**OK - I am using Stig JSON parser.**

Here is my ListVenuesView.h (connected to table view)

```
#import <UIKit/UIKit.h>
#import "SBJson.h"

@interface ListVenuesView : UITableViewController <UITableViewDelegate, UITableViewDataSource> {
    IBOutlet UITableView *venueList;
    NSMutableDictionary *jsonArray;
}

@property (nonatomic, retain) IBOutlet UITableView *venueList;
@property (nonatomic, retain) NSMutableDictionary *jsonArray;

@end

```

jsonArray is used to store the JSON data and eventually the proper array.

And here is my ListVenuesView.m (key areas in question)

```
- (void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"Table View Loaded");

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;

    // This is where we load the JSON data

    NSURL *jsonURL = [NSURL URLWithString:@"http://www.thebigfishexperience.org.uk/sources/ajax/venue-json.php?location=peterborough"];

    NSString *jsonData = [[NSString alloc] initWithContentsOfURL:jsonURL];
    NSLog(@"%@", jsonData);

    // Convert jsonData to array
    self.jsonArray = [jsonData JSONValue];
    NSLog(@"%@", jsonArray);

    NSLog(@"count is: %i", [self.jsonArray count]);

    // Release NSString and NSURL
    [jsonURL release];
    [jsonData release];

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [self.jsonArray count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    NSMutableDictionary *dict = [self.jsonArray objectAtIndex: indexPath.row];

    cell.textLabel.font = [UIFont fontWithName:@"Arial" size:15.0];

    cell.textLabel.text = [dict objectForKey:@"venueName"];
    cell.detailTextLabel.text = [dict objectForKey:@"venueCordDist"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    // Configure the cell...

    return cell;

```

Also how can I use the data in the cells to go to another subview of the nav controller which gives me a back button and displays the info from the JSON string just for that particular cell that has been tapped.

I think this has something to do with it? Not sure though as this is my first app i am building! So probably expect more pleas of assistance - ha ! ;)

```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    /*
     DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"Nib name" bundle:nil];
     // ...
     // Pass the selected object to the new view controller.
     [self.navigationController pushViewController:detailViewController animated:YES];
     [detailViewController release];
     */
}

```