我试图从几年前开始构建一个运行良好的应用程序,但现在却出现错误,因为找不到GooglePlaces.h。
否则,我会得到许多未声明的标识符,例如
[突出显示的枚举属性:kGMSAutocompleteMatchA
我尝试安装/更新Pod。
我已经检查了路径
尝试了平常的事情,但没有运气。我希望以下内容可以帮助某人帮助我...
#import "XLFormGooglePlacesAutoCompletePickerViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#import <GooglePlaces/GooglePlaces.h>
@interface AddressModal : NSObject
@property(retain,nonatomic) NSAttributedString* text;
@end
@implementation AddressModal
+addressModalWithTitle: (NSAttributedString*)title
{
AddressModal* modal = [[self alloc] init];
if(modal){
NSMutableAttributedString *highlighted = [title mutableCopy];
[highlighted enumerateAttribute:kGMSAutocompleteMatchAttribute
inRange:NSMakeRange(0, highlighted.length)
options:0
usingBlock:^(id value, NSRange range, BOOL *stop) {
if(value){
[highlighted addAttribute:NSBackgroundColorAttributeName value:[UIColor colorWithRed:1.0 green:0.9778 blue:0.5437 alpha:1.0] range:range];
}
}];
modal.text = highlighted;
}
return modal;
}
@end
部署目标12.2
XCode 10.3
pod 'UIActionSheet-Blocks'
pod 'GooglePlaces'
pod 'GoogleMaps'
pod 'GooglePlacePicker'
pod 'XLFormGooglePlacesAutoCompletePicker', :path => 'XLFormGooglePlacesAutoCompletePicker'
pod 'QRCodeReaderViewController'
最佳答案
从以下链接下载最新版本的GooglePlaces和GoogleMaps:“ https://dl.google.com/dl/cpdc/8a8ad90cc90f312f/GooglePlaces-3.3.0.tar.gz”“ https://dl.google.com/dl/cpdc/97fb1c4023fbdb2b/GoogleMaps-3.3.0.tar.gz”
将GoogleMapsBase.framework和GooglePlaces.framework拖到项目的文件夹中
将框架添加到目标