【问题标题】:catching exception of googlemaps for ios捕获 googlemaps for ios 的异常
【发布时间】:2015-05-03 13:19:20
【问题描述】:

我正在使用 Google 地图进行反向 GEO 编码。

当我手动终止应用程序时,我得到了“崩溃”:

-[GMSAsyncInitServices sharedInitWithSync:]
Background execution would crash in this scenario

google的解决方法是:

You can catch this exception, and attempt re-initialize GMSServices once you have come to the foreground.

https://code.google.com/p/gmaps-api-issues/issues/detail?id=7716

我没问题,反正代码快要死了。问题是我在框架中的任何地方都找不到GMSBackgroundAppException(我需要一个它所在的 h 文件才能捕获它)

【问题讨论】:

    标签: ios google-maps google-maps-sdk-ios


    【解决方案1】:

    Here's the bug report for this on Google's forums.

    GMSBackgroundAppException 不是公开的,也无法被捕获,正如您所发现的。我建议遵循该线程中给出的关于在进入后台时对地图视图进行快照的建议,这可能会首先避免这个问题。

    【讨论】:

    • 是的...但问题是我没有地图视图。我在appdelegate 上运行[GMSServices provideAPIKey:XXX],然后只使用[[GMSGeocoder geocoder] reverseGeocodeCoordinate:self.location completionHandler: ^(GMSReverseGeocodeResponse *response, NSError *error) { 没有对象快照...
    • 哈!在这种情况下,听起来他们的后台检查过于激进,您应该将其报告为错误。
    猜你喜欢
    • 1970-01-01
    • 2014-05-31
    • 1970-01-01
    • 2021-04-13
    • 1970-01-01
    • 2021-02-12
    • 2014-11-24
    • 2011-10-27
    相关资源
    最近更新 更多