当我运行它时,我的应用程序构建良好,而单元测试也构建良好
当我为CGAffineTransform添加一些代码时,单元测试失败(应用程序仍然正常)
模拟器和设备的行为相同
错误信息:
Undefined symbols for architecture i386:
"_CGAffineTransformMakeTranslation", referenced from:
-[PhysicsObject hasPoint:] in PhysicsObject-23B4A02B8F0621AD.o
"_CGAffineTransformMakeRotation", referenced from:
-[PhysicsObject hasPoint:] in PhysicsObject-23B4A02B8F0621AD.o
"_CGAffineTransformConcat", referenced from:
-[PhysicsObject hasPoint:] in PhysicsObject-23B4A02B8F0621AD.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我尝试了来自的建议
http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/
http://sealedabstract.com/code/tired-of-getting-mach-o-linker-errors-when-unit-testing/
Apple Mach-O Linker Error when compiling for device
而且没有任何效果:(我怀疑这与一个框架有关,尤其是找不到。我似乎无法确定哪个框架。非常感谢帮助。
最佳答案
前缀_CG是CoreGraphics.framework