iOS google places API - compile error - use of undeclared identifier GMSAutocompleteViewController

不打扰是莪最后的温柔 提交于 2019-12-13 01:40:27

问题


I have installed GoogleMaps SDK using CocoaPods.
For some screen I need to use Google Places API
Here is the code

GMSAutocompleteViewController *acController = [[GMSAutocompleteViewController alloc] init];
acController.delegate = self;
[self presentViewController:acController animated:YES completion:nil];

Which I have got from https://developers.google.com/places/ios-api/autocomplete
The error - use of undeclared identifier 'GMSAutocompleteViewController'


回答1:


Have you added #import <GoogleMaps/GoogleMaps.h> to the file?

The other possibility is that you have an older version of the GoogleMaps pod (GMSAutocompleteViewController was added in version 1.11). To fix this, just run

pod update

in the project directory.



来源:https://stackoverflow.com/questions/34861056/ios-google-places-api-compile-error-use-of-undeclared-identifier-gmsautocomp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!