找不到协议声明 MKAnnotation
代码是:
@interface RouteMapAnnotation : NSObject <MKAnnotation>
{
CLLocationCoordinate2D coordinate;
NSString* title;
NSString* subtitle;
}
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, copy) NSString* title;
@property (nonatomic, copy) NSString* subtitle;
@end
这是我遇到的错误的快照:
https://skitch.com/kuntul/rws3c/smartrek -routemapannotation.h
有什么问题吗?我已经在同一个项目上完成了这个并且它有效..
The code is:
@interface RouteMapAnnotation : NSObject <MKAnnotation>
{
CLLocationCoordinate2D coordinate;
NSString* title;
NSString* subtitle;
}
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, copy) NSString* title;
@property (nonatomic, copy) NSString* subtitle;
@end
Here's a snapshot of the error I have:
https://skitch.com/kuntul/rws3c/smartrek-routemapannotation.h
What is wrong? I've done this on the same exact project and it works..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您还记得
#import
吗?Did you remember to
#import <MapKit/MapKit.h>
?您导入了 MKAnnotation.h 吗?
have you imported MKAnnotation.h ?
您忘记了
#import
。确实没有其他原因会出现这种情况。
You forgot to
#import <MapKit/MapKit.h>
.There really is no other reason why this would come up.
只需插入一行
#import < MapKit/MapKit.h>
Just insert One line
#import < MapKit/MapKit.h>