今天重新整理了项目,所有库都重新添加了一遍,结果运行时程序crash,锁定到报错信息为:
dyld: Library not loaded: @rpath/XCTest.framework/XCTest
Referenced from: /Users/MyPC/Library/Developer/CoreSimulator/Devices/3A08052B-ABF9-4CAC-937B-0B79FCAB5611/data/Containers/Bundle/Application/E281837D-EB8F-4D54-88C6-E6E41FF72EDD/NameTest.app/NameTest
Reason: image not found
如图:
查询一番后将解决方法记录下来:
Target ->Build Phases -> Link Binary With Libraries 添加图中所提示的XCTest.framework,并且将其默认状态更改为“Optional”就可以了,具体如图所示: