【发布时间】:2015-12-16 18:20:57
【问题描述】:
我正在尝试在我的代码中使用 Google Places API 自动完成功能。
import UIKit
import GoogleMaps
class ViewController: UIViewController, GMSMapViewDelegate {
var placesClient: GMSPlacesClient?
override func viewDidLoad() {
super.viewDidLoad()
placesClient = GMSPlacesClient()
let filter = GMSAutocompleteFilter()
filter.type = GMSPlacesAutocompleteTypeFilter.City
placesClient?.autocompleteQuery("Pizza", bounds: nil, filter: filter, callback: { (results, error: NSError?) -> Void in
if let error = error {
print("Autocomplete error \(error)")
}
for result in results! {
if let result = result as? GMSAutocompletePrediction {
print("Result \(result.attributedFullText) with placeID \(result.placeID)")
}
}
})
}
}
当我运行它时,我收到了这个错误:CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/
有什么想法吗?
【问题讨论】:
-
似乎是 iOS9/Xcode 7 的问题。查看code.google.com/p/gmaps-api-issues/issues/detail?id=8459 && stackoverflow.com/questions/32233939/…
标签: google-places-api swift2 ios9