属性标题复制属性与从MKAnnotation继承的属性不匹配

时间:2012-04-03 22:57:16

标签: properties copy title

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

我的警告是:属性'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

1 个答案:

答案 0 :(得分:29)

变化:

  

@property(nonatomic,retain)NSString * Title;

成:

  

@property(非原子,复制)NSString * title;