赞
踩
$ gem install cocoapods
$ pod init
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'HelloWorld' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for HelloWorld
pod 'SnapKit', '~> 5.0.0'
end
$ pod install
在完成上述所有动作后,在Xcode中运行程序,出现以下错误:
framework not found SnapKit
在Xcode打开项目的工作目录下,存在**.xcodeproj和**.xcworkspace两个目录,前者为项目目录;后者为工作区目录。当我们通过项目目录从Xcode中打开项目并运行时,就会出现第三库框架找不到的问题。而使用工作区目录从Xcode打开项目时,能够正常工作。
总之,当我们加入第三方库时,请通过****.xcworkspace**打开项目。
[!] Please close any current Xcode sessions and use MyApp.xcworkspace for this project from now on.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。