遇到下图错误:
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>就可以了。
本文解决了一个关于在iOS开发过程中因未正确导入UIKit框架而导致的UIImageView类型未声明的问题。通过简单地添加#import <UIKit/UIKit.h>,即可解决编译时出现的错误。
1万+

被折叠的 条评论
为什么被折叠?



