1申请KEY 和 填写 Bundle Indentifierios
2.Xcode 建立一个项目 xcode
项目中使用pods >使用xcode新建项目 >终端cd 到项目的目录(拖过去)框架
使用
pod init
它会自动建立一个Podfile文件 (会在目录下显示多出这个文件)
编辑Podfile文件
sudo vi Prodfile
输入 i 进行编辑this
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'spatarget 'gdMap' do
platform :ios, '7.0' #手机的系统
pod 'AMap3DMap' #3D地图SDK
#pod 'AMap2DMap' #2D地图SDK (2D和3D不能同时使⽤用)
pod 'AMapSearch' #搜索服务SDK
endcodetarget 'gdMapTests' doorm
endip
esc 退出编辑 :wq 保存退出get
接着输入
pod install
把相关框架添加到项目中,在执行命令前把xcode和模拟器都关了
运行项目 打开的是 xxxx.xcworkspaceit导入
#import "ViewController.h"
#import <MAMapKit/MAMapKit.h>
#import <AMapSearchKit/AMapSearchAPI.h>
#define APIKye @"c56ac0e567fd208d47f030eedca1b4f0"
NSLocationWhenInUseUsageDescription