响应事件传递nextResponder

原创
2013/03/14 20:13
阅读数 2.2K

官方解释

UIView implements this method by returning the UIViewController object that manages it (if it has one) or its superview (if it doesn’t); UIViewController implements the method by returning its view’s superview; UIWindow returns the application object, and UIApplication returns nil.

id next = [self nextResponder];
while(![next isKindOfClass:[ViewController class]]) {
    next = [next nextResponder];
}
if ([next isKindOfClass:[ViewController class]]) {
    controller = (ViewController *)next;
}

展开阅读全文
加载中

作者的其它热门文章

打赏
0
1 收藏
分享
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部