在UIVIew中实现下面方法:
- (UIViewController *)viewController
{
UIResponder *responder = self;
while ((responder = [responder nextResponder]))
{
if ([responder isKindOfClass:[UIViewController class]])
{
return (UIViewController *)responder;
}
}
return nil;
}