使用cocoapods导入的高德地图为什么头文件xcode 找不到头文件

高德官方自动部署(只有简单的使用)/api/ios-sdk/guide/deploy/
开题“
注意:::下载什么类库需要$ pod search AFNetworking(类库名字)!!
偷懒:复制下面创建一个脚本直接进行安装。或者复制到命令行粘贴。&
sudo gem install cocoapods
gem sources --remove https://rubygems.org/
echo '更改代理,有可能出错,如果出错暴力更改即可'
gem sources -a http://ruby.taobao.org/
gem sources -l
sudo gem install cocoapods
一、cocoaPods简介
类库管理工具。主要用途就是更新项目中的类库比较方便。
前置环境Ruby环境:
Ruby:一种脚本语言,特点是简单快捷并面向对象。objective-c就是一种典型的简单的面相对象语言。
Ruby安装:
Madordie:~ KTJ$ gem sources --remove https://rubygems.org/
https://rubygems.org/ removed from sources
Madordie:~KTJ $ gem sources -a https://ruby.taobao.org/
https://ruby.taobao.org/ added to sources
Madordie:~ KTJ$ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/&
cocoaPods安装:
Madordie:~ KTJ$ sudo gem install cocoapods
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Fetching: i18n-0.6.11.gem (100%)
此处省略两千行。。。&
& & & & Madordie:~ KTJ$
$ pod search AFNetworking 在cocoaPods中搜索AFNetworking库。如果支持则打印库的相关信息。
组织更新规则,有点类似Makefile。。
命令进入项目目录。
--------以下操作都是基于高德地图的使用。----------------
注意:下面这条命令用来解决pod install 时候xcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use xcode-select to change
Madordie:firstaMap KTJ$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Madordie:firstaMap KTJ$
Madordie:keith1408 KTJ$ cd amap-自动部署3D/
Madordie:amap-自动部署3D KTJ$ ls
Podfile amap-自动部署3D.xcodeproj
amap-自动部署3D amap-自动部署3DTests
Madordie:amap-自动部署3D KTJ$ vim Podfile
Madordie:amap-自动部署3D KTJ$ pod install
Analyzing dependencies
CocoaPods 0.35.0.rc1 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
[!] Unable to find a specification for `AMap333DMap` depended upon by Podfile.
Madordie:amap-自动部署3D KTJ$ vim Podfile
Madordie:amap-自动部署 KTJ$ ls
JGShowMapViewController.h amap-自动部署
JGShowMapViewController.m amap-自动部署.xcodeproj
Podfile amap-自动部署.xcworkspace
Podfile.lock amap-自动部署Tests
Madordie:amap-自动部署 KTJ$ cat Podfile
platform :ios, '7.0'
pod 'AMap2DMap'
pod 'AMapSearch'
Madordie:amap-自动部署 KTJ$ cat ../amap-自动部署3D/Podfile
platform :ios, '7.0'
pod 'AMap3DMap'
pod 'AMapSearch'
Madordie:amap-自动部署 KTJ$
Madordie:amap-自动部署3D KTJ$ pod install
Analyzing dependencies
CocoaPods 0.35.0.rc1 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Downloading dependencies
Installing AMap3DMap (2.4.0)
Installing AMapSearch (2.4.0)
Generating Pods project
Integrating client project
[!] From now on use `amap-自动部署3D.xcworkspace`.
[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:
source '/CocoaPods/Specs.git'
Madordie:amap-自动部署3D KTJ$
四、更新类库
Madordie:amap-自动部署3D KTJ$ pod update
Update all pods
Analyzing dependencies
CocoaPods 0.35.0.rc1 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Downloading dependencies
Using AMap3DMap (2.4.0)
Using AMapSearch (2.4.0)
Generating Pods project
Integrating client project
[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:
source '/CocoaPods/Specs.git'
Madordie:amap-自动部署3D KTJ$
该类库功能确实强大,并且一次搭建,永久使用。一行代码搞定类库更新添加神马的。提高开发xiaol!
总结一下大致步骤:
搭建ruby环境。
安装cocoaPods
根据需求编写Podfile (该步骤比较重要)
根据需求更新类库
不要害怕错误,看错误日志,基本上学过英语的都OK
阅读(...) 评论()工具(13)
从别处拷贝过来的程序Xcode使用模拟器编译之后,可能会出现这样的Bug,就是用cocoapods导入的第三库中头文件找不到库中的某些文件
“OBJC_CLASS$_AFHTTPRequestSerializer”, referenced from:
解决方法如下图所示:
Pods -& Pods -&Build Active Architecture Only 属性设置为NO
有可能会出现这种情况当Pods中的Build Active Architecture Only属性设置为NO后,某一个三方库还会出现上面的Bug 这时候就需要单独的设置这个三方库的Build Active Architecture Only 属性设置为NO
以AFNetwoking三方库为例:
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:48257次
积分:1025
积分:1025
排名:千里之外
原创:49篇
转载:54篇
(1)(3)(2)(1)(2)(1)(14)(1)(1)(46)(5)(4)(10)(12)Pages: 2/3
涓婚? : 浣跨敤cocoapods瀵煎叆鐨勯珮寰峰湴鍥句负浠}

我要回帖

更多关于 xcode 找不到头文件 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信