IOS 错误:error: unknown type name 'UIImageView'

遇到下图错误:

In file included from /Users/admin/Desktop/自定义定位地图/自定义定位地图/GeoPointCompass.m:9:
/Users/admin/Desktop/自定义定位地图/自定义定位地图/GeoPointCompass.h:17:31: error: unknown type name 'UIImageView'
@property (nonatomic, retain) UIImageView *arrowImageView;
                              ^
/Users/admin/Desktop/自定义定位地图/自定义定位地图/GeoPointCompass.h:17:1: error: property with 'retain (or strong)' attribute must be of object type
@property (nonatomic, retain) UIImageView *arrowImageView;
^
/Users/admin/Desktop/自定义定位地图/自定义定位地图/GeoPointCompass.m:96:10: error: use of undeclared identifier 'UIView'
        [UIView animateWithDuration:1.0f animations:^{
         ^
3 errors generated.


原因:你报错的文件中没有#import <UIKit/UIKit.h>

加上#import <UIKit/UIKit.h>就可以了。

猜你喜欢

转载自blog.csdn.net/u014640208/article/details/46727403