美文网首页
开发中遇到的LOG错误.

开发中遇到的LOG错误.

作者: 动机至善私心了无 | 来源:发表于2017-11-04 17:54 被阅读382次

    今天帮网上的朋友解决问题,因为以前遇到过,突然之间想不起来了,所以想着以后遇到log错误就记录下来.便于以后查找

    1. *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SettingTableViewCell 0x7f83578a6600> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key label.'
      这个崩溃是因为SettingTableViewCell这个xib中的label名字的这个控件被重复命名,如:


      041ED1999CFBA8BB04122203DC42F2CE.png

      删除一个即可.

    2.有时候在模拟器上跑程序,会发现tableView上的分割线时显时不显,这是因为模拟器的原因,真机上跑就没事了

    3.-[__NSCFNumber rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0xb000155bf7e18803
    这是因为把NSNumber类型的变量赋值给了NSString.转换一下类型就好了(很久以前遇到的BUG了,有点记不太清了)

    4.只有使用点语法才能触发该属性的set和get方法.

    5.could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.
    这是因为有人在描述一个NSString对象的时候使用了assign(大坑)

    6.有时候使用ScrollView会遇到contentSize内容显示位置不对
    简单点说就是automaticallyAdjustsScrollViewInsets根据按所在界面的status bar,navigationbar,与tabbar的高度,自动调整scrollview的 inset,设置为no,不让viewController调整,我们自己修改布局即可~
    self.automaticallyAdjustsScrollViewInsets = NO;

    7.使用masonry适配,不能以scrollView的右和下为参照物.否则会出现界面不滚动,布局不正确的问题

    8.在iOS11系统上跑不起来项目,log输出nw_proxy_resolver_create_parsed_array PAC evaluation error: NSURLErrorDomain: -1004
    这是因为在Mac系统中设置了网络自动代理而导致
    解决方案:系统偏好设置 → 网络 → 高级 → 代理 → 取消自动代理配置

    9.library not found for -ljcore-ios-1.1.5
    不知道为什么极光的1.1.6core版本不行,只能重新使用1.1.5版本的

    10.在iphone X上崩溃.Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIStatusBar_Modern 0x7fc1f0c11700> valueForUndefinedKey:]: this class is not key value coding-compliant for the key foregroundView.'
    原来版本的友盟plus有问题,更新就好了

    11.Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
    PID: 1708, TID: 268523, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
    Backtrace:
    警告是因为原本需要在主线程执行的代码被放在了子线程里边,shareSDK 中把状态栏设置在子线程,所以输出此警告

    12.*** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UITableViewRowData.m:473

    这个错误的原因是在计算tableview的高度是出错,自己计算高度,但是计算未计算出来高度,导致height为Nan,之后报这个错误.
    或者没有进行iOS11的判断,直接写了
    self.tableView.estimatedSectionFooterHeight = 0;
    self.tableView.estimatedSectionHeaderHeight = 0;
    也会发生崩溃

    1. This app's CFBundleDevelopmentRegion is not a string value. This can lead to unexpected results at runtime. Please change CFBundleDevelopmentRegion in your Info.plist to a string value.
      缺少CFBundleDevelopmentRegion值,添加就可(首选语言设置)

    2. *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'MASLayoutConstraint constant is not finite! That's illegal. constant:nan firstAnchor:<NSLayoutDimension:0x1c0c607c0 "XQImageCollectionView:0x1069c0e00.height"> secondAnchor:(null)'
      这是因为有控件的约束不对,比如控件的约束为负数,或者为Nan的值,做个判断

    isnan(x)
    

    15 <_UISystemGestureGateGestureRecognizer: 0x1c41dcc50>: Touch: Failed to receive system gesture state notification before next touch
    我遇到这种错误是因为和web联调, 接收他那边的点击事件,但是他们的传值不能什么都没有括号里面一定要有东西比如 "".

    相关文章

      网友评论

          本文标题:开发中遇到的LOG错误.

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