找不到“ GooglePlaces / GooglePlaces.h”文件-未声明的kGMSAutocompleteMatchAttribute

时间:2019-08-05 03:44:01

标签: ios objective-c google-maps

我试图从几年前开始构建一个运行良好的应用程序,但现在由于未找到GooglePlaces.h而出现错误。

没有得到许多未声明的标识符,例如 [突出显示的enumerateAttribute: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'

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

  1. 从以下链接下载最新版本的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
  2. 将GoogleMapsBase.framework和GooglePlaces.framework拖到您项目的文件夹
  3. 将框架添加到目标