歡迎關(guān)注微信公眾號(hào):全棧工廠
今天在做工程內(nèi)存泄漏檢查時(shí)發(fā)現(xiàn)SnapKit本身存在的內(nèi)存泄漏,官方更新了新的bate版诫睬,但是更新后始終編譯不過(guò):提示錯(cuò)誤:
Undefined symbols for architecture arm64:
"protocol witness table for SnapKit.ConstraintItem : SnapKit.ConstraintRelatableTarget in SnapKit", referenced from:
XXX.UserViewController.(setupUI () -> ()).(closure #4) in UserViewController.o
"SnapKit.ConstraintViewDSL.bottomMargin.getter : SnapKit.ConstraintItem", referenced from:
XXX.UserViewController.(setupUI () -> ()).(closure #4) in UserViewController.o
"SnapKit.ConstraintViewDSL.makeConstraints (closure : (make : SnapKit.ConstraintMaker) -> ()) -> ()", referenced from:
XXX.UserViewController.setupUI** () -> () in UserViewController.o
在GitHub上提問(wèn)后對(duì)方建議清空一下DerivedData文件夾,清空之后,Bingo! 問(wèn)題解決堡称!
DerivedData文件夾的路徑為:
/Users/用戶/Library/Developer/Xcode/DerivedData
另外,這個(gè)緩存文件夾還是要經(jīng)常清理的疑俭,太占存儲(chǔ)空間啦A改亍!
注:文中如有任何錯(cuò)誤钞艇,請(qǐng)各位批評(píng)指正!