我如何设置猕猴桃与Cocoapods?

我对猕猴桃和Cocoapods都很陌生。即使在我开始使用Kiwi之前,我的Cocoapods已经启动并运行了,但是我的测试目标失败,出现如下错误:

Undefined symbols for architecture i386:
  "_CGRectZero", referenced from:
  -[EGOImageButton initWithPlaceholderImage:delegate:] in libPods.a(EGOImageButton.o)

这是我的Podfile:

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
0
额外 编辑
意见: 2
有人可以为我制作奇异果标签吗?谢谢。
额外 作者 Steve Moser,

2 答案

你必须做一些基本的设置,类似于Kiwi Wiki从零开始安装Kiwi的说明( https://github.com/allending/Kiwi/wiki/Guide:-Up-and-Running-with-Kiwi

  1. 在Xcode中,将一个名为“test”的单元测试目标添加到应用程序项目中(添加目标/可可触摸单元测试软件包)
  2. 将Kiwi引用添加到PodFile(如上所述)
  3. 运行pod install。
  4. 编辑主要目标的架构,将单元测试目标添加到“测试”选项卡(以便您可以执行cmd-U)
  5. 将主目标可执行文件的路径添加到单元测试目标中的BundleLoader构建设置:例如, $(BUILT_PRODUCTS_DIR)/Foo.app/Foo
  6. 将您的Kiwi测试添加到测试目标
0
额外
另外,我必须将$(BUNDLE_LOADER)添加到测试主机
额外 作者 zeiteisen,

Do your tests rely on your other Cocoapods dependencies? In your Podfile, try removing the :exclusive => true in your test target. This will allow your other dependencies to be included in your test target, but will limit Kiwi to only be in your test target.

0
额外