使用Xcode 7/iOS9的Google Maps API无法在路径错误时加载优化模型 [英] Failed to load optimized model at path error with Google Maps API using Xcode 7 / iOS9

查看:154
本文介绍了使用Xcode 7/iOS9的Google Maps API无法在路径错误时加载优化模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的代码中使用Google Places API自动完成功能.

I am trying to use the Google Places API autocomplete feature in my code.

    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/ 有什么想法吗?

When I run it I am getting this error: CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/ Any ideas?

推荐答案

-ObjC 添加到"Other Linker Flags"

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

这为我解决了.

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

After I added this flag I received some errors regarding missing symbols (such as _CBAdvertisementDataManufacturerDataKey).

我在* Build Phases -> Link Binary With Libraries*.

这篇关于使用Xcode 7/iOS9的Google Maps API无法在路径错误时加载优化模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆