26

我已经从 Cocoa Pods 开始了。

在最初尝试并通过此 Ray Wenderlich 教程成功连接 AFNetworking 之后,我现在有了这个工作区。

在此处输入图像描述

我现在想添加更多的依赖项,比如 core-plot 。我发现这个链接到 Core-Plot 的“PodSpec”

问题是,我不知道如何进一步实现这一点......任何人都可以快速了解要修改的内容以及终端中要运行的命令?

4

6 回答 6

44

You need to add the pod in Podfile and do pod install from terminal that's it. The steps can be summarized as

  1. In terminal change the directory to your project directory containing *.xcodeproj
  2. Run open Podfile. Which opens the Podfile in textEdit.
  3. Add pod'CorePlot', '~> 1.4' to it and save.
  4. Run pod install -- NOTE* that is **pod update if already installed.

You are good to go.

于 2013-10-12T04:31:34.160 回答
9

在您最初将 CocoaPods 安装到项目中后,您可以通过编辑 Podfile 添加新的依赖项(或删除未使用的依赖项)。然后只需再次运行 pod install 即可。

如果您使用 AppCode,它有很好的集成支持,因此它可以为您更新 Pods,只需在 AppCode 中编辑 Podfile,它会建议您添加新的依赖项。

Pods-AppCode

编辑:

实际上,pod install添加新 pod 后再次运行,而不是 update

于 2013-10-12T09:38:21.510 回答
7

只需运行以下命令

pod update
于 2015-05-19T07:17:34.580 回答
3

转到您的项目文件夹并打开终端并将项目源设置为终端

-> Run open Podfile. Which opens the Podfile in textEdit.
-> Add pod'CorePlot', '~> 1.4' to it and save.
-> Run pod install -- NOTE(if u want to update all podfile then run pod update)
于 2015-09-28T06:38:19.260 回答
1

仅供参考:根据谷歌组中的这个链接,1.4 可能是可可豆荚中的问题

我试过了:

pod 'CorePlot', '1.3'

它可以编译......这一定是1.4和可可豆荚的问题

于 2013-10-12T05:13:03.010 回答
1

为了像我这样的豆荚菜鸟的利益。

更新 Xcode 项目中的 pod 文件。

首先关闭 xCode。

打开终端

类型

 sudo gem

然后在提示时输入您的系统密码

接下来 cd 进入您拥有项目和 podfile 的目录。

注意* 如果您的文件夹名称有特殊字符(如“&”),请键入第一部分并按 Tab 键。终端将自动完成并为您转义特殊字符:-)

一旦进入您拥有 podfile 的项目文件夹

类型

 pod update

而已。等待终端完成并瞧。

终端菜鸟的额外提示

列出文件夹中的文件类型 ls

要重新输入上一个命令,请使用键盘上的向上向下箭头

于 2015-10-17T19:09:48.050 回答