【发布时间】: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