简体   繁体   English

Cocoapod:为内部目标安装Pod(可可框架)

[英]Cocoapod: Install pod for internal target (cocoa framework)

Hi I want to modularize a project by creating framework and adding it to a project. 嗨,我想通过创建框架并将其添加到项目中来对项目进行模块化。 but when I want to install pods for specific target (I mean frameworks and main target) I will get error. 但是,当我要为特定目标安装Pod时(我是指框架和主要目标),我会收到错误消息。

I had searched for this specific problem and didn't find anything useful. 我已经搜索了此特定问题,但没有发现任何有用的信息。

Error Image is Here 错误图片在这里

Podfile Image is Here Podfile图片在这里

Error : 错误:

[!] Unable to find a target named Photo , did find testForModule . [!]无法找到名为Photo的目标,但找到了testForModule

Podfile: Podfile:

# sources
source 'https://github.com/CocoaPods/Specs.git'

# global config
platform :ios, '11.0'
use_frameworks!
workspace 'testForModule'

def networkAndParsingPods
  pod 'Alamofire'
end

def uiPods
  pod 'TextFieldEffects'
end

target 'testForModule' do
  networkAndParsingPods
end

target 'Photo' do
  uiPods
end

I'm doing this because of separation concerns, because some module work with specific pod and some module shouldn't access to that. 我这样做是出于分离方面的考虑,因为某些模块可以与特定的容器配合使用,而某些模块则不能访问该模块。

thanks for any help 谢谢你的帮助

在将Photo指定为Podfile中的目标之前, Photo必须是Xcode项目中的目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM