时间:2021-02-09 14:31:01 | 栏目:iOS代码 | 点击:次
1.先重写uiviewcontrol的方法
- (UIViewController *)viewController { for (UIView* next = [self superview]; next; next = next.superview) { UIResponder *nextResponder = [next nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]]) { return (UIViewController *)nextResponder; } } return nil; }
2.接下来是点击cell的方法
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ qunzuDetailViewController *qc=[[qunzuDetailViewController alloc]initWithNibName:@"qunzuDetailViewController" bundle:[NSBundle mainBundle]]; [[self viewController]presentViewController:qc animated:YES completion:nil]; }