gpt4 book ai didi

objective-c - 向 XCode 5 项目添加测试时出现问题

转载 作者:搜寻专家 更新时间:2023-10-30 20:02:37 26 4
gpt4 key购买 nike

我决定是时候为我的 iPhone 应用程序编写一些测试了。不幸的是,这并不顺利。我创建了一个新的测试类,但出现以下错误。看起来它正在向我引入 OS X 库,但我不知道为什么......

Ld /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator/3rdRevolutionTests.octest/3rdRevolutionTests normal i386
cd /Users/philswenson/dev/3rdRev/3R_iOS
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator -F/Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Intermediates/3rdRevolution.build/Debug-iphonesimulator/3rdRevolutionTests.build/Objects-normal/i386/3rdRevolutionTests.LinkFileList -bundle_loader /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator/3rdRevolution.app/3rdRevolution -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework SenTestingKit -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Intermediates/3rdRevolution.build/Debug-iphonesimulator/3rdRevolutionTests.build/Objects-normal/i386/3rdRevolutionTests_dependency_info.dat -o /Users/philswenson/Library/Developer/Xcode/DerivedData/3rdRevolution-crkklmdwurdjtrbjvjedcqqeoyvk/Build/Products/Debug-iphonesimulator/3rdRevolutionTests.octest/3rdRevolutionTests

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_XCTestCase", referenced from:
_OBJC_CLASS_$_IsoDateTest in IsoDateTest.o
"_OBJC_METACLASS_$_XCTestCase", referenced from:
_OBJC_METACLASS_$_IsoDateTest in IsoDateTest.o
"__XCTFailureFormat", referenced from:
-[IsoDateTest testExample] in IsoDateTest.o
"__XCTFailureHandler", referenced from:
-[IsoDateTest testExample] in IsoDateTest.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是我的框架搜索路径设置的屏幕截图:http://cl.ly/T7gV

关于如何解决这个问题有什么想法吗?

最佳答案

根据阅读“我决定是时候编写一些测试了”,我猜您创建项目已经有一段时间了。所以也许……

  • 您使用 Xcode 4 创建了项目。测试目标将使用 SenTestingKit。
  • 您使用 Xcode 5 添加了 IsoDateTest.m。最新的文件模板使用 XCTest。

检查测试目标build设置下的库列表。将 SenTestingKit.framework 替换为 XCTest.framework。

关于objective-c - 向 XCode 5 项目添加测试时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20794416/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com