title: How do I put this JSON data into my table view? Please help me, I'm living in a nightmare :)
body: <p>I have a question with respect to putting JSON data into a table view. I'm at the point where I have successfully parsed the data, as its coming up in my console - but I cant for the life of me figure out how to put this data into my table view. I've spent a whole week solid trying to get this to work trying every combination of things under the sun. </p>
  
  <p>Most of the time it just crashes, sometimes it tells me "[NSCFString count]: unrecognized selector" which I believe happens because I'm trying to count a string which throws an exception? - Anyways, with the code below, it just prints the data I want in the console and shows me a load of grey lines in the table view, so its not crashing (which is the best I can do at the moment I guess). </p>
  
  <p>Any help/advice on how to populate the table with all of the eventNames will be greatly appreciated. My eventual plan for this view was to have the eventNames in the list which when selected push a new view controller showing data for that specific event.</p>
  
  <p>Here's the view did load method:</p>
  
  <pre><code>- (void)viewDidLoad {
  [super viewDidLoad];
  
  NSURL *url = [NSURL URLWithString:@"http://myurl........."];
  NSString *jsonreturn = [[NSString alloc] initWithContentsOfURL:url];
  
  NSLog(jsonreturn); //successfully returns the result of the page
  
      //to parse it i have made a sbjsonparser object
      SBJsonParser *json = [[SBJsonParser new] autorelease];
      NSError *jsonError;
      NSDictionary *parsedJSON = [json objectWithString:jsonreturn error:&amp;jsonError];
  
          //if successful, i can have a look inside parsedJSON - its worked as an NSdictionary and NSArray
          NSArray* events = [parsedJSON objectForKey:@"Events"];
          //eventNameList = [parsedJSON objectForKey:@"Events"];
          NSLog(@"show me events: %@", events);
          //NSLog(@"show me events: %@", eventNameList);
  
              //lets try and get to rows
              //NSEnumerator *enumerator = [events objectEnumerator];
              NSEnumerator *enumerator = [events objectEnumerator];
              NSDictionary* item;
                  while (item = (NSDictionary*)[enumerator nextObject]) {
              NSLog(@"event item:eventName = %@", [item objectForKey:@"EventName"]); //everything to this point works and shows in the console
  
              }
  </code></pre>
  
  <p>}</p>
  
  <p>And here is the table view code:</p>
  
  <pre><code>//customise the number of sections in the table view
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  return 1;
  }
  
  //customise number of rows
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  return [eventNameList count];
  
  NSLog(@"here");
  
  }
  
  //customise the appearance of table view cells
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath {
  
  static NSString *CellIdentifier = @"Cell";
  
  //try to get a reusable cell
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
  //create a new cell if there is not reusable cell available
  if (cell == nil) {
      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  }
  
  //set the text display for the cell
  NSString *cellValue = [eventNameList objectAtIndex:indexPath.row];
  
  cell.textLabel.text = cellValue;
  
  //NSLog(@"event item from table view:eventName = %@", eventNameList);
  
  return cell;
  }
  </code></pre>
  
  <p>Thanks in advance, any help or pointers are greatly welcomed and appreciated :) </p>