百度地图 IOS sdk 错误总结

原创
2014/04/12 16:00
阅读数 2.3K

      最近添加百度地图sdk的时候遇到错误很多,真是很痛苦,但是客户就要百度地图,我也只好硬着头皮去改(发誓以后一定创业,只用最好的东西),最后终于添加成功,下面总结一下出现过的错误。


(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 就能解决。

    

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
2 收藏
0
分享
返回顶部
顶部