官网地址:http://developer.baidu.com/map/index.php?title=iossdk
1. 参照官网提示,申请秘钥
2. 参照官网提示,配置.framework形式的开发包
3. 在工程的Build Settings--> Library Search Paths中设置百度地图SDK的路径。
4.
(1)在AppDelegate.h中定义变量
BMKMapManager* _mapManager;
(2)在AppDelegate.m 的 didFinishLaunchingWithOptions 函数中,使用刚刚申请的秘钥初始化百度sdk
_mapManager = [[BMKMapManager alloc]init];
BOOL ret = [_mapManager start:@"秘钥" generalDelegate:nil];
if (!ret) {
NSLog(@"manager start failed!");
}
5. 在要使用的类中引入#import <BaiduMapAPI/BMapKit.h>