2017-08-24 90 views
0

我正在尝试在我的项目中使用SwiftIconFont Framework。我遵循列出的所有方向。我加了pod 'SwiftIconFont', '~> 2.7'然后执行pod install。终端吐出:向Swift项目添加框架

Analyzing dependencies 
Downloading dependencies 
... 
... 
Installing SwiftIconFont (2.7.0) 
... 
... 
Generating Pods project 
Integrating client project 
Sending stats 
Pod installation complete! There are 8 dependencies from the Podfile and 13 total pods installed. 

从这个终端的消息来看,应该SwiftIconFont已成功安装在我的项目。但是,当我去我的项目尝试链接SwiftIconFont框架时,添加的目录显示为空。

SwiftIconFont directory is empty

我试图import SwiftIconFont但Xcode中说,没有这样的模块存在。我该怎么做才能够使用这个框架?

我还将github "0x73/SwiftIconFont"添加到我的Cartfile中,然后执行carthage update,即使此步骤可能不必要。为您解决问题

+0

只需重新启动您的xcode并重试即可 –

+0

您打开.xcworkspace文件吗? – Keuha

+0

CocoaPods和Carthage使用不同的方法来处理项目中的依赖关系,因此您必须决定使用哪一个。对于CocoaPods,请确保您使用'.xcworkspace'而不是通常的'.xcodeproj'。 –

回答

1

我不知道为什么会这样,但一个方法是去到您的构建设置和定义框架搜索路径到包含有问题的框架文件夹。如果框架放置在项目目录中,只需将框架搜索路径设置为$(SRCROOT)并将其设置为递归。