Skip to content

Instantly share code, notes, and snippets.

@kiero
Created December 5, 2012 23:49
Show Gist options
  • Select an option

  • Save kiero/4220589 to your computer and use it in GitHub Desktop.

Select an option

Save kiero/4220589 to your computer and use it in GitHub Desktop.
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.dealsVC == nil) {
DealsTableViewController *aDealVC = [[DealsTableViewController alloc] init];
self.dealsVC = aDealVC;
[aDealVC release];
}
City *city = [self.cities objectAtIndex:indexPath.row];
self.dealsVC.navigationItem.title = city.name;
NSLog(@"Slug name: %@", city.nameSlug);
JSONConnection *jsonConnection = [[JSONConnection alloc] init];
[jsonConnection fetchDealsFromCity:city.nameSlug withDelegate:self.dealsVC];
[self.navigationController pushViewController:self.dealsVC animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment