标签:for 控制器 skin class classname next amp ant send
开发中有的时候需要涉及当前视图的父级视图,可以通过UIResponder来获取,有两种实现方式: UIView *next=sender; while ([next superview]) { next=[next superview]; UIResponder *nextResponder = [next nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]]&&![nextResponder isKindOfClass:[UINavigationController class]]) { Class cls=[nextResponder class]; NSLog(@"ClassName:%@",cls); } NSLog(@"FlyElephant---%@",next); NSLog(@"FlyElephant---%@",nextResponder); } 还有一种类似的实现方式如下: for (UIView *next = [sender superview]; next; next = next.superview) { NSLog(@"UIView---%@",next); UIResponder *nextResponder = [next nextResponder]; NSLog(@"UIResponder---%@",nextResponder); }
标签:for 控制器 skin class classname next amp ant send
原文地址:http://www.cnblogs.com/Free-Thinker/p/7601387.html