可可应用程序沙盒 - 加载bundle时出错



我将我的应用程序设置为使用沙盒,现在我无法运行我的单元测试。我收到此错误消息:

objc[18812]: GC: forcing GC OFF because OBJC_DISABLE_GC is set 2012-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=1 IDEBundleInjection.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 框架。有什么想法吗?

谢谢!

如果在项目设置编辑器中创建新的生成配置,则可以进入"生成设置"选项卡,并仅禁用该配置的代码签名和授权。然后,在方案编辑器中,选择用于单元测试的配置,保持发布和调试版本不变,同时仍能够运行单元测试。

我在xcode 5中遇到了同样的问题。事实证明,我必须在正常目标中禁用沙盒,然后测试目标才能正确加载。

最新更新