使用Google Maps iOS SDK 1.4设置mapView.delegate [英] set mapView.delegate with Google Maps iOS SDK 1.4

查看:69
本文介绍了使用Google Maps iOS SDK 1.4设置mapView.delegate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我刚刚从Google Maps iOS SDK 1.3.1更新到1.4,现在当我将委托设置为 mapView_.delegate = self 之类时,我的应用程序崩溃了.如果删除此行,则不会调用我的委托方法.

如何在1.4版中设置委托?
谢谢


I just updated from Google Maps iOS SDK 1.3.1 to 1.4 and now my app crashes when I set the delegate like mapView_.delegate = self. If I delete this line my delegate methods are not called.

How can I set the delegate in v 1.4?
Thanks

推荐答案

希望您已添加googlemaps框架并正确捆绑.确保您的头文件具有

Hope you have added the googlemaps framework and bundle correctly. Ensure your header file has

@interface yourViewController : UIViewController<GMSMapViewDelegate>

在实现文件中,确保仅在初始化mapView_之后设置委托.请遵循以下顺序:

In your implementation file ensure that you set the delegate only after initialising your mapView_. That is below order should be followed:

mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.delegate = self;

这篇关于使用Google Maps iOS SDK 1.4设置mapView.delegate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆