【问题标题】:Issue with Google Places API in iOS 6.1?iOS 6.1 中的 Google Places API 问题?
【发布时间】:2015-11-28 08:43:54
【问题描述】:

我允许用户在我的 iPhone 项目中搜索地点。为此,我使用Google Places API for iOS。我在我的项目中使用以下代码。

- (void) makeAutoComplete :(UITextField *) textField
{
    NSLog(@"Searching for :%@",textField.text);
    GMSAutocompleteFilter *filter = [[GMSAutocompleteFilter alloc] init];
    filter.type = kGMSPlacesAutocompleteTypeFilterEstablishment;
//    [_placesClient autocompleteQuery:@"fun republic mall"
    [_placesClient autocompleteQuery:textField.text
                              bounds:nil
                              filter:filter
                            callback:^(NSArray *results, NSError *error) {
                                if (error != nil) {
                                    NSLog(@"Autocomplete error %@", [error localizedDescription]);
                                    return;
                                }
                                //                                NSLog(@"%@",results);
                                NSString *searchedResults = @"";
                                for (GMSAutocompletePrediction* result in results) {

                                    NSLog(@"Result '%@' with placeID %@", result.attributedFullText.string, result.placeID);
                                    searchedResults = [searchedResults stringByAppendingString:[NSString stringWithFormat:@"%@ /n",result.attributedFullText.string]];


                                }
                                //displaying searched results in console
                                NSLog(@"Filter  %@",searchedResults);


                            }];

}

它在我的 iOS 8.1 版本设备上运行良好。但是当我尝试在 iOS 6.1 版本中运行相同的项目时,我得到了以下错误。

  dyld: Symbol not found: _NSURLSessionDownloadTaskResumeData
  Referenced from: /var/mobile/Applications/0451B511-AA2F-0000-0000-0FA4D53DABC1/GMS.app/GMS
  Expected in: /System/Library/Frameworks/Foundation.framework/Foundation
 in /var/mobile/Applications/0451B511-AA2F-0000-0000-0FA4D53DABC1/GMS.app/GMS

即使我尝试在 iOS 6.1 中运行 SDKDemo,我也会遇到同样的错误。但它在 OS 8.1 设备中运行良好。

谁能提供任何关于在 iOS 6.1 版本中使用谷歌地方搜索 API 的建议。

我也想知道使用Google Places API的最低iOS版本支持

【问题讨论】:

    标签: ios google-api google-places-api google-maps-sdk-ios ios6.1


    【解决方案1】:

    适用于 iOS 的 Google Maps SDK 仅支持 iOS 7.0 及更高版本。

    来自https://developers.google.com/maps/documentation/ios-sdk/releases

    Google Maps SDK for iOS 的最低目标 iOS 版本现在是 7.0。不再支持 6.0 版。

    【讨论】:

      【解决方案2】:

      只有 iOS 7.0 以上版本支持 SDK。所以请使用合适的来运行谷歌地图SDK。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-03-08
        • 2018-08-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-11-08
        相关资源
        最近更新 更多