google-places-api - 无法使用 Xcode 7/iOS9 使用 Google Maps API 在路径错误时加载优化模型

标签 google-places-api swift2 ios9

我正在尝试在我的代码中使用 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/有任何想法吗?

最佳答案

添加 -ObjC 到“Other Linker Flags

(Build Settings -> Linking -> Other Linker Flags). 

这为我解决了它。

添加此标志后,我收到了一些关于缺少符号的错误(例如 _ CBAdvertisementDataManufacturerDataKey )。

我添加了 Accelerate CoreBluetooth * 中的框架 Build Phases -> Link Binary With Libraries*.

关于google-places-api - 无法使用 Xcode 7/iOS9 使用 Google Maps API 在路径错误时加载优化模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32671696/

相关文章:

ios - GMSAutocompleteResultsViewController 显示有限的结果?

google-places-api - 我网站上的 Google 评论

swift - 使用 AVAudioPlayer swift 播放音频文件

swift - 编译 Swift 资源卡在 Xcode 7.0.1 中

ios - 更新到 IOS 9 和 Xcode 7.4 后出现多个错误

ios - Google Place API 网址 iOS

neo4j - 如何在neo4j中使用纬度和经度搜索特定半径内的所有节点

macos - 屏幕中央窗口

ios - swift 2 在不同的 View Controller 中应用相同的背景

ios - 删除 UIAlertController 中 textField 周围的填充和边框