7

这些是调用警告的行:@property (nonatomic, retain) NSString *Title; @property (nonatomic, 保留) NSString *Subtitle;

我的警告是:property 'title' 'copy' 属性与从 'MKAnnotation' 继承的属性不匹配

有任何想法吗?

提前致谢!

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>



@interface MapAnnotation : NSObject <MKAnnotation> {
    CLLocationCoordinate2D coordinate;
    NSString *title;
    NSString *subtitle;
    int listIndex;
}

@property (nonatomic) CLLocationCoordinate2D coordinate;
@property (nonatomic, retain) NSString *Title; 
@property (nonatomic, retain) NSString *Subtitle; 
@property (nonatomic) int listIndex;

@end
4

1 回答 1

31

改变:

@property (nonatomic, 保留) NSString *Title;

进入:

@property (nonatomic, copy) NSString *title;

于 2012-05-01T13:17:28.160 回答