Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用GoogleMaps SDK时出现iOS-Segue问题_Ios_Iphone_Swift_Google Maps_Google Maps Sdk Ios - Fatal编程技术网

使用GoogleMaps SDK时出现iOS-Segue问题

使用GoogleMaps SDK时出现iOS-Segue问题,ios,iphone,swift,google-maps,google-maps-sdk-ios,Ios,Iphone,Swift,Google Maps,Google Maps Sdk Ios,我在使用GoogleMapsSDK时遇到了一个奇怪的问题。在我显示谷歌地图的视图中,嵌入了一个导航控制器。在导航栏上,我有一个连接到新视图的栏按钮。当按下按钮时,序列为laggy,不显示任何内容 以下是正在发生的事情: 不知道问题是什么。我有相同的设置,但没有实现GoogleMapsSDK 以下是GoogleMaps视图控制器: import UIKit import GoogleMaps class GoogleMapsViewController: UIViewController, CL

我在使用GoogleMapsSDK时遇到了一个奇怪的问题。在我显示谷歌地图的视图中,嵌入了一个导航控制器。在导航栏上,我有一个连接到新视图的栏按钮。当按下按钮时,序列为laggy,不显示任何内容

以下是正在发生的事情:

不知道问题是什么。我有相同的设置,但没有实现GoogleMapsSDK

以下是GoogleMaps视图控制器:

import UIKit
import GoogleMaps

class GoogleMapsViewController: UIViewController, CLLocationManagerDelegate, GMSMapViewDelegate {

    var locationManager = CLLocationManager()
    var tacoLocations = [TacoLocation]()
    var tacoLocationPlace_id :String!

    override func viewDidLoad() {
        super.viewDidLoad()

        self.locationManager = CLLocationManager()
        self.locationManager.delegate = self
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
        self.locationManager.distanceFilter = kCLDistanceFilterNone
        self.locationManager.requestWhenInUseAuthorization()
        self.locationManager.startUpdatingLocation()

        let lat = self.locationManager.location?.coordinate.latitude
        let lng = self.locationManager.location?.coordinate.longitude


        // creates the map and zooms the current user location, at a 15.0 zoom
        let camera = GMSCameraPosition.camera(withLatitude: lat!, longitude: lng!, zoom: 15.0)
        let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
        view = mapView

        for location in self.tacoLocations {

            let marker = GMSMarker()

            let lat = location.locationLat
            let lng = location.locationLng

            marker.position = CLLocationCoordinate2D(latitude: lat!, longitude: lng!)
            marker.title = location.name

            if location.open_now == false {
                marker.snippet = "\(location.vicinity!)\nClosed"
            } else if location.open_now == true {
                marker.snippet = "\(location.vicinity!)\nOpen"
            } else {

            }
            marker.userData = location

            marker.icon = UIImage(named: "taco_marker.png")
            marker.infoWindowAnchor = CGPoint(x: 0.5, y: 0.2)

            marker.map = mapView  
        }
        // enable my location dot
        mapView.isMyLocationEnabled = true
        mapView.delegate = self

    }

    //MARK: GMSMapViewDelegate

    func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -> UIView? {
        let customWindow = Bundle.main.loadNibNamed("CustomInfoWindow", owner: self, options: nil)?.first as! CustomInfoWindow

        customWindow.nameLabel.text = marker.title
        customWindow.addressLabel.text = marker.snippet

        return customWindow
    }

    func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) {

        let tacoLocation = marker.userData as! TacoLocation
        self.tacoLocationPlace_id = tacoLocation.place_id

        DispatchQueue.main.async {
            self.performSegue(withIdentifier: "MoreInfoSegue", sender: self)
        }
    }

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {


        if segue.identifier == "MoreInfoSegue" {


            let tabVC = segue.destination as! UITabBarController
            let moreInfoVC = tabVC.viewControllers?[0] as! MoreInfoViewController
            let reviewVC = tabVC.viewControllers?[1] as! ReviewViewController

            moreInfoVC.tacoLocationPlace_id = self.tacoLocationPlace_id
            reviewVC.tacoLocationPlace_id = self.tacoLocationPlace_id

        } else if segue.identifier == "ARSegue" {

            //segue to new view that is not working correctly.

        }

    }
}
第二个视图控制器中的唯一内容是viewdidload


非常感谢您的帮助

我卸载了谷歌地图播客,然后重新安装。这解决了我的问题。一定是xcode的bug