Hi guys i have different section in my tableview ( more than 6) and each one has different rows. But only one of them leads to next view controllers here is the code but when i click it its not working
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger section = [indexPath section];
NSUInteger row = [indexPath row];
switch (section)
{
case 5:
{
switch (row)
{
case 0:
{
Language_view_controller * language_controller = [Language_view_controller alloc开发者_C百科];
[self.navigationController pushViewController:language_controller animated:YES];
[language_controller release];
}
break;
default:
break;
}
}
break;
default:
break;
}
}
You are just allocating the memory for your view controller, you also need to initialize it by doing something like this:
Language_view_controller * language_controller = [[Language_view_controller alloc] initWithNibName:@"Language_view_controller" bundle:nil];
[self.navigationController pushViewController:language_controller animated:YES];
[language_controller release];
精彩评论