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];
}
时间: 2024-10-14 14:35:06