美文网首页
Application tried to push a nil

Application tried to push a nil

作者: 爩龘 | 来源:发表于2017-10-13 10:22 被阅读16次

    bug: 点击指定功能push到另一个控制器无效

    断点调试在 log 日志里面出现了这么一段话 Application tried to push a nil 并且点击事件直接无效了,在点击事件里打了断点发现时 Class 没有初始化成功带导致的  

    UIViewController *pCtrl = [[NSClassFromString(@"PresenterDetailCtrl") alloc] init];

    这里pCtrl 返回了一个nil 

    1:检查一下该文件是存在的 

    2:检查右侧的配置 原来是 Target Membership 里的选项没有勾选 这里只有.m的文件需要勾选 .h 文件不需要勾选 重新build 之后功能 正常运行

    相关文章

      网友评论

          本文标题:Application tried to push a nil

          本文链接:https://www.haomeiwen.com/subject/gyaayxtx.html