View中实现navigationController push

- (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;

}

[[self viewController].navigationController pushViewController:description animated:YES];

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • *7月8日上午 N:Block :跟一个函数块差不多,会对里面所有的内容的引用计数+1,想要解决就用__block...
    炙冰阅读 7,325评论 1 14
  • 通常使用self.navgationController是在Viewcontroller里面调用的,但是有的时候需...
    楠Y阅读 1,599评论 0 0
  • 1、禁止手机睡眠[UIApplication sharedApplication].idleTimerDisabl...
    DingGa阅读 4,811评论 1 6
  • 今天突然打开了百年难得打开的QQ动态,一个很不耀眼的小红包引起了我的注意,顺藤摸瓜,发现了QQ和微信评论功能的好几...
    Csmessi阅读 5,092评论 8 13
  • 还没觉察到此去经年时的物是人非,就已湿了眼眶,不习惯看到我们一点点的改变,其实,只是因为你们早已不再和我过着一样的...
    AprilD阅读 2,187评论 0 0