Cocoapods 安装

Cocoapods Installation

亲爱的,

我有这种情况,我正在尝试使此控件工作:

https://github.com/mikaoj/BSImagePicker

它是一个图像选择器,需要使用 Cocoapods 安装。我知道这是一个新手问题。

但我下载了已安装的 cocoapods,然后转到我的示例文件夹和 运行 "pod install",它成功了:

"Pod installation complete! There is 1 dependency from the Podfile and 3 total pods installed."

所以一切都应该很棒。但是当我打开项目并尝试 运行 它时,出现此错误:

"No such module 'BSImagePicker'"

我不明白这里的工作原理。在 "pod install" 我是 cocoapods 的新手之后,我还应该做些什么吗?也许我错过了什么。

感谢您的支持

谢谢

三分:

  1. 确保您的 pod 文件中有 use_frameworks! 行未注释。如果不是,请取消注释并重新安装 pods.
  2. 确保您打开的是工作区,而不是项目文件。清理 (Cmd+Shift+K) 和构建 (Cmd+B)。
  3. 在要使用 BSImagePicker 的代码中,确保导入它,即 import BSImagePicker

我刚试过了,效果很好,下面是 Podfile 的样子:

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'ExampleApp' do
    pod "BSImagePicker", "~> 2.2"
end

target 'ExampleAppTests' do

end

target 'ExampleAppUITests' do

end