Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa touch 我如何用椰子荚设置猕猴桃?_Cocoa Touch_Unit Testing_Cocoapods_Kiwi - Fatal编程技术网

Cocoa touch 我如何用椰子荚设置猕猴桃?

Cocoa touch 我如何用椰子荚设置猕猴桃?,cocoa-touch,unit-testing,cocoapods,kiwi,Cocoa Touch,Unit Testing,Cocoapods,Kiwi,我对猕猴桃和椰子荚都是新手。我已经安装并运行了CoCoapod,但即使在我开始玩猕猴桃之前,我的测试目标也失败了,错误如下: Undefined symbols for architecture i386: "_CGRectZero", referenced from: -[EGOImageButton initWithPlaceholderImage:delegate:] in libPods.a(EGOImageButton.o) 这是我的播客文件: platform :ios d

我对猕猴桃和椰子荚都是新手。我已经安装并运行了CoCoapod,但即使在我开始玩猕猴桃之前,我的测试目标也失败了,错误如下:

Undefined symbols for architecture i386:
  "_CGRectZero", referenced from:
  -[EGOImageButton initWithPlaceholderImage:delegate:] in libPods.a(EGOImageButton.o)
这是我的播客文件:

platform :ios
dependency 'RestKit/Network', '~>0.10.0'
dependency 'RestKit/UI', '~>0.10.0'
dependency 'RestKit/ObjectMapping', '~>0.10.0'
dependency 'RestKit/ObjectMapping/XML', '~>0.10.0'
dependency 'RestKit/ObjectMapping/JSON', '~>0.10.0'
dependency 'RestKit/ObjectMapping/CoreData', '~>0.10.0'
dependency 'SVProgressHUD'
dependency 'EGOImageLoading'
dependency 'OHAttributedLabel'
dependency 'SFHFKeychainUtils'

target :test, :exclusive => true do
    dependency 'Kiwi'
end

您的测试是否依赖于其他Cocoapods依赖项?在pod文件中,尝试删除测试目标中的
:exclusive=>true
。这将允许您的其他依赖项包含在测试目标中,但会将Kiwi限制为仅包含在测试目标中。

您必须进行一些基本设置,类似于Kiwi Wiki上关于从头安装Kiwi的说明()

  • 在Xcode中,将名为“Test”的单元测试目标添加到应用程序项目中(添加目标/单元测试包)
  • 将Kiwi引用添加到pod文件(如上所述)
  • 运行pod安装
  • 编辑主目标的模式,将单元测试目标添加到测试选项卡(这样您就可以执行cmd-U)
  • 将主目标的可执行文件路径添加到单元测试目标中的BundleLoader构建设置中:例如$(builded\u PRODUCTS\u DIR)/Foo.app/Foo
  • 将您的猕猴桃测试添加到测试目标

  • 有人能帮我做个猕猴桃标签吗?谢谢。另外,我不得不向测试主机添加$(BUNDLE\u LOADER)