UIDevice uniqueGlobalDeviceIdentifier(百度地图API的那些事)

百度地图冲突 :
1,与TapDetectingView 【Copyright (C) 2009 Apple Inc. All Rights Reserved】 相互冲突【推测 :百度静态库里 封装了此类】
2,设置了-all_load参数时  
在工程中如果有iflyMSC.framework【讯飞语音api】和OpencoreAMR 【三方音频转码工具 // 将AMR文件解码成WAVE  和 WAVE 转AMR】下   会有冲突

步骤:
下载: http://developer.baidu.com/map/sdk-ios.htm

注册Key: http://dev.baidu.com/wiki/static/imap/key/

导入:

将libbaidumapapi.a (分为模拟器/真机版, 名字相同, 只能存在一个) 拖进工程

将inc文件夹拖进工程

将mapapi.bundle拖进工程 (包含一些默认图片)

保证至少有一个文件为.mm

导入CoreLocation.framework

导入QuartzCore.framework

Project->BuildSetting->Linking->Other Linker Flags 添加 -all_load (用来保证xib中可用)

其他:
1)编译正常,运行报  [UIDevice uniqueGlobalDeviceIdentifier]: unrecognized selector sent to此时需要 other linker  flags 添加 -all_load参数。
         具体:Project ->build settings ->linking->Other Linker flags
2)编译报  Undefined symbols for architecture armv7。请检查有没有添加QuartzCore.framework 和 CoreLocation.framework

3)  BMKMapManager 强烈建议通过单例模式管理起来,并且不要手动调用其release方法。

4)  进行用户位置定位时除了要设置showsUserLocation = YES,还要在mapView:didUpdateUserLocation:方法中调用setCenterCoordinate:animated
         另外一定要在dealloc中,或者其他离开页面的地方调用showsUserLocation= NO,否则会出现第二次push到定位页面时,不会重新定位问题。
  (5) 必须至少让一个类保持.mm文件,或者按照官方修改编译器类型。
(6) lipo –create Release-iphoneos/libbaidumapapi.a Release-iphonesimulator/libbaidumapapi.a –output libbaidumapapi.a 如果报错,请改成
     lipo –create –output libbaidumapapi.a Release-iphoneos/libbaidumapapi.a Release-iphonesimulator/libbaidumapapi.a 就能解决。

猜你喜欢

转载自lizaochengwen.iteye.com/blog/1766054