我正在尝试将a UILabel与IBOutlet我班级中的创建链接起来.
我的应用程序崩溃,出现以下错误.这是什么意思?我该如何解决?
***由于未捕获的异常'NSUnknownKeyException'终止应用程序,原因:'[<UIViewController 0x6e36ae0> setValue:forUndefinedKey:]:此类不是密钥XXX的密钥值编码.
https://developers.google.com/maps/documentation/ios-sdk/utility/marker-clustering
我正在为地图聚类工作.在地图聚类中
private var mapView: GMSMapView!
Run Code Online (Sandbox Code Playgroud)
用于mapView但找不到任何GMSMapView!在故事板连接.
从故事板我发现
@IBOutlet var mapView: MKMapView!
Run Code Online (Sandbox Code Playgroud)
这就产生了问题.当我使用exampled谷歌地图时,它会抛出错误
这个类不是键值mapView的关键值编码兼容.
这里有完整的代码:
import UIKit
import MapKit
import GooglePlaces
import GoogleMaps
// Point of Interest Item which implements the GMUClusterItem protocol.
class POIItem: NSObject, GMUClusterItem {
var position: CLLocationCoordinate2D
var name: String!
init(position: CLLocationCoordinate2D, name: String) {
self.position = position
self.name = name
}
}
let kClusterItemCount = 10000
let kCameraLatitude = -33.8
let kCameraLongitude = 151.2
class FirstViewController: UIViewController , GMUClusterManagerDelegate,
GMSMapViewDelegate {
// @IBOutlet var mapView: …Run Code Online (Sandbox Code Playgroud)