我想在单击表格 View 的单元格时推送 View 。代码如下:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tableView.tag == todoTableViewTag) {
NSLog(@"aa");
ViewControlleraaa* testvc = [[ViewControlleraaa alloc] initWithNibName:@"ViewControlleraaa" bundle:nil];
[self.navigationController pushViewController:testvc animated:YES];
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
但它根本不起作用。
我有 ViewControlleraaa.h ViewControlleraaa.m 和 ViewControlleraaa.xib 但我除了创建它们之外什么也没做。
那么问题出在哪里呢?
最佳答案
创建一个从您的 TableView Controller 到 ViewControlleraaa 的“通用”转场并使用“performSegueWithIdentifier”。如果该方法无法执行,那么您可能想尝试使用“presentViewController”。
关于ios - 单击 uitableviewcell 时推送 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26820197/