開發(fā)中遇到的LOG錯誤.

今天幫網(wǎng)上的朋友解決問題,因為以前遇到過,突然之間想不起來了,所以想著以后遇到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名字的這個控件被重復(fù)命名,如:


    041ED1999CFBA8BB04122203DC42F2CE.png

    刪除一個即可.

2.有時候在模擬器上跑程序,會發(fā)現(xiàn)tableView上的分割線時顯時不顯,這是因為模擬器的原因,真機上跑就沒事了

3.-[__NSCFNumber rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0xb000155bf7e18803
這是因為把NSNumber類型的變量賦值給了NSString.轉(zhuǎn)換一下類型就好了(很久以前遇到的BUG了,有點記不太清了)

4.只有使用點語法才能觸發(fā)該屬性的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內(nèi)容顯示位置不對
簡單點說就是automaticallyAdjustsScrollViewInsets根據(jù)按所在界面的status bar,navigationbar,與tabbar的高度,自動調(diào)整scrollview的 inset,設(shè)置為no,不讓viewController調(diào)整,我們自己修改布局即可~
self.automaticallyAdjustsScrollViewInsets = NO;

7.使用masonry適配,不能以scrollView的右和下為參照物.否則會出現(xiàn)界面不滾動,布局不正確的問題

8.在iOS11系統(tǒng)上跑不起來項目,log輸出nw_proxy_resolver_create_parsed_array PAC evaluation error: NSURLErrorDomain: -1004
這是因為在Mac系統(tǒng)中設(shè)置了網(wǎng)絡(luò)自動代理而導(dǎo)致
解決方案:系統(tǒng)偏好設(shè)置 → 網(wǎng)絡(luò) → 高級 → 代理 → 取消自動代理配置

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:
警告是因為原本需要在主線程執(zhí)行的代碼被放在了子線程里邊,shareSDK 中把狀態(tài)欄設(shè)置在子線程,所以輸出此警告

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

這個錯誤的原因是在計算tableview的高度是出錯,自己計算高度,但是計算未計算出來高度,導(dǎo)致height為Nan,之后報這個錯誤.
或者沒有進行iOS11的判斷,直接寫了
self.tableView.estimatedSectionFooterHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
也會發(fā)生崩潰

  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值,添加就可(首選語言設(shè)置)

  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)'
    這是因為有控件的約束不對,比如控件的約束為負數(shù),或者為Nan的值,做個判斷

isnan(x)

15 <_UISystemGestureGateGestureRecognizer: 0x1c41dcc50>: Touch: Failed to receive system gesture state notification before next touch
我遇到這種錯誤是因為和web聯(lián)調(diào), 接收他那邊的點擊事件,但是他們的傳值不能什么都沒有括號里面一定要有東西比如 "".

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容