iOS实现tableViewCell或collectionCell中点击界面按钮跳转

//找到父类界面

- (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;

}

使用时   [self viewController].navgationcontroller push....

posted @ 2017-07-03 15:36  孙富有(iOS工程师)  阅读(1259)  评论(0编辑  收藏  举报