我将应用程序设置为使用沙箱,但现在无法运行单元测试。我收到此错误消息:objc[18812]: GC: forcing GC OFF because OBJC_DISABLE_GC is set2012-06-14 09:19:42.689 Gitpilot[18812:603] Error loading /Users/corey/Library/Developer/Xcode/DerivedData/Gitpilot-bedgmtkbdheptpbpjfklegmqyipi/Build/Products/Debug/GitpilotTests.octest/Contents/MacOS/GitpilotTests: dlopen(/Users/corey/Library/Developer/Xcode/DerivedData/Gitpilot-bedgmtkbdheptpbpjfklegmqyipi/Build/Products/Debug/GitpilotTests.octest/Contents/MacOS/GitpilotTests, 262): no suitable image found. Did find: /Users/corey/Library/Developer/Xcode/DerivedData/Gitpilot-bedgmtkbdheptpbpjfklegmqyipi/Build/Products/Debug/GitpilotTests.octest/Contents/MacOS/GitpilotTests: open() failed with errno=1IDEBundleInjection.c: Error loading bundle '/Users/corey/Library/Developer/Xcode/DerivedData/Gitpilot-bedgmtkbdheptpbpjfklegmqyipi/Build/Products/Debug/GitpilotTests.octest'2012-06-14 09:19:42.733 Gitpilot[18812:603] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/rs/63y00fxj7dj07g91vrswhk240000gn/T/com.gitpilot.Gitpilot/com.gitpilot.Gitpilot.savedState
我正在使用带有OCMock的SenTesting框架。有任何想法吗?
谢谢!
最佳答案
如果在项目设置编辑器中创建新的构建配置,则可以进入“build设置”选项卡,并仅禁用该配置的代码签名和权利。然后,在方案编辑器中,选择用于单元测试的配置,使发布版本和调试版本保持不变,同时仍然能够运行单元测试。
关于objective-c - cocoa 应用沙箱-加载捆绑包时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11035263/