我有一个 7 行的表格视图,我想单击我的行并加载 detailView( uiViewController )
我可以选择该行,我可以看到登录控制台,但它从不加载详细视图
请你给我一些点击,有什么问题?
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSLog(@"selected rows");
MyBookDetailView *c = [[MyBookDetailView alloc] init];
[self.navigationController popToRootViewControllerAnimated:NO];
[self.navigationController pushViewController:c animated:YES];
}
我也尝试 performSelectorOnMainThread 但它仍然是可点击的,我在加载我的视图控制器时遇到问题,我还在 - (void)viewDidLoad 方法中添加了委托,
提前致谢!
后期代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
MyBookDetailView *c = [[MyBookDetailView alloc] initWithNibName:@"MyBookDetailView" bundle:nil];
[self.navigationController pushViewController:c animated:YES];
}