ios - Google maps swift ios mapwithframe on GMSMapView 错误

标签 ios swift google-maps callstack

我正在使用 Google Maps iOS SDK(使用 swift),在多次成功运行我的程序后,我决定退出 Xcode 以稍后继续我的项目。重新打开 Xcode 并尝试重新启动我的项目后,出现此错误:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSManagedObject tileCoords]: unrecognized selector sent to instance 0x7c037e90'.

据说 GMSMapView 对象上没有 mapWithFrame 方法,尽管我直接从 Google map SDK 网站上复制了示例代码。

我能否获得更多有关处理此问题的指导?这是调用堆栈的图像 Image以及它被炸毁的代码行。

let camera = GMSCameraPosition.cameraWithLatitude(37.5784623,longitude:-77.42166750000001, zoom: 4)

在这里爆炸 ---->

mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera) 

enter image description here

最佳答案

尝试仅使用框架初始化 map View ,在 View 中将显示如下设置其相机:

mapView = GMSMapView(frame: CGRectZero)
// on view will appear
mapView.camera = GMSCameraPosition.cameraWithLatitude(37.5784623,longitude:-77.42166750000001, zoom: 4)

关于ios - Google maps swift ios mapwithframe on GMSMapView 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33140107/

相关文章:

objective-c - 呈现模态视图 Controller 隐藏导航栏

ios - 如何同时播放2个视频?

swift - 加速度计检测手机运动

ios - 使用 uipresentviewcontroller 显示 uiviewcontroller 时,状态栏与导航栏重叠

r - 从 R 传递经度和纬度参数以读取 Google map 中的 URL 并提取路线

asp.net - 如何在谷歌地图上设置中心?

ios - 如何在 Swift 中从 Google map 的信息窗口跳转到新的 ViewController?

ios - 当 canShowCallout 为 YES 时必须实现标题

ios - 在 TableView 部分中排序核心数据对象

ios - UICollectionView becomeFirstResponder 错误行为