标签:
//根据View获取控制器
- (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;
}
标签:
原文地址:http://www.cnblogs.com/Jordandan/p/5703658.html