问题
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