我是ios应用程序开发的新手,所以我需要帮助"使用文本字段(目标c)自动完成谷歌的地方(目标c)"一步一步的流程以便更好地了解所以请帮助我,谢谢提前。
答案 0 :(得分:1)
您应该尝试查看Google开发者网站。
您可以使用此方法:
Tue Sep 29 09:21:39 UTC 2015: INFO:
Tue Sep 29 09:58:12 UTC 2015: INFO:
Tue Sep 29 09:58:58 UTC 2015: INFO:
Tue Sep 29 10:36:46 UTC 2015: INFO:
Tue Sep 29 11:10:26 UTC 2015: INFO:
Tue Sep 29 11:52:35 UTC 2015: INFO:
Tue Sep 29 12:19:37 UTC 2015: INFO:
Tue Sep 29 13:02:04 UTC 2015: INFO:
Tue Sep 29 13:55:41 UTC 2015: INFO:
Tue Sep 29 13:56:11 UTC 2015: INFO:
Tue Sep 29 13:56:17 UTC 2015: INFO:
Tue Sep 29 13:56:21 UTC 2015: INFO:
更多信息:https://developers.google.com/places/ios-api/autocomplete
安装SDK:https://developers.google.com/places/ios-api/start
如果要为文本字段实现自动填充,请尝试以下方法:
- (void)placeAutocomplete {
GMSAutocompleteFilter *filter = [[GMSAutocompleteFilter alloc] init];
filter.type = kGMSPlacesAutocompleteTypeFilterCity;
[_placesClient autocompleteQuery:@"Sydney Oper" //this should be your textfield text
bounds:nil
filter:filter
callback:^(NSArray *results, NSError *error) {
if (error != nil) {
NSLog(@"Autocomplete error %@", [error localizedDescription]);
return;
}
for (GMSAutocompletePrediction* result in results) {
NSLog(@"Result '%@' with placeID %@", result.attributedFullText.string, result.placeID);
}
}];
}
对于autocomplete turotial:http://www.raywenderlich.com/336/auto-complete-tutorial-for-ios-how-to-auto-complete-with-custom-values
答案 1 :(得分:0)
适用于iOS的Google Places API现在附带了UI控件,可让您更轻松地为自己的应用添加自动填充功能。有关详细信息,请参阅Place Autocomplete Guide。