欢迎关注微信公众号:全栈工厂
今天在做工程内存泄漏检查时发现SnapKit本身存在的内存泄漏,官方更新了新的bate版,但是更新后始终编译不过:提示错误:
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上提问后对方建议清空一下DerivedData文件夹,清空之后,Bingo! 问题解决!
DerivedData文件夹的路径为:
/Users/用户/Library/Developer/Xcode/DerivedData
另外,这个缓存文件夹还是要经常清理的,太占存储空间啦!!
注:文中如有任何错误,请各位批评指正!