通过uiview 得到所在的viewcontroller

- (HXBaseViewController *)appName_viewController {

    Class vcc = [HXBaseViewController class];

    UIResponder *responder = self;

    while ((responder = [responder nextResponder]))

        if ([responder isKindOfClass: vcc])

            return (HXBaseViewController *)responder;

    return nil;

}

你可能感兴趣的:(通过uiview 得到所在的viewcontroller)