XCTest.framework
needs to be linked only to the unit test target in your project. It should not be added to the UI application target.
What I have found is when adding XCTest.framework
Xcode adds extra
to Framework Search Paths
"$(SDKROOT)/Developer/Library/Frameworks"
"$(DEVELOPER_LIBRARY_DIR)/Frameworks"
$(DEVELOPER_FRAMEWORKS_DIR)
This causes linker issue,
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To resolve this issue in XCode 5.1 goto the main ProjectWindow, Tab Build Settings -> Section Search Path -> Framework Search Paths and edit to remove
appearing the paths.
Hope that helps!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…