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

标签 properties copy title

这些是调用警告的行:
@property (nonatomic, retain) NSString *Title;
@property (nonatomic, retain) 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

最佳答案

改变:

@property (nonatomic, retain) NSString *Title;



进入:

@property (nonatomic, copy) NSString *title;

关于properties - 属性标题复制属性与从 MKAnnotation 继承的属性不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10002647/

相关文章:

java - @Value 返回 null

c# - 文件已存在时的 File.Copy() 性能

ios - 是否可以在不调用 getter 的情况下检查属性是否为 nil?

Java > JSch.如何从设置文件获取 SFTP 连接的属性?

html - css object-fit 属性有什么问题

c# - 从 C# 连接到 Windows 文件复制 API

python - Numpy 高级索引和基本索引

javascript - 获取所选选项卡的标题

javascript - HTML 属性中的标签?

jquery - 替换元素标题框?