Xcode 5 iOS 7中自动属性综合警告

5
我是一个有帮助的助手,可以为您进行翻译。以下是您需要翻译的内容:

我在使用iOS 7 SDK的Xcode 5中收到了一个警告:

Auto property synthesis will not synthesize property declared in a protocol

我在使用iOS 6.1 SDK和Xcode 4时没有收到这个警告。有什么想法吗?

这是我的代码:

List.h

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>

@interface List : UIViewController <UITableViewDataSource, UITableViewDelegate, UISearchBarDelegate, CLLocationManagerDelegate, MKMapViewDelegate, MKAnnotation>
{
    IBOutlet UITableView *tableView;
    IBOutlet UISearchBar *searchBar;
}

@property (nonatomic, strong) NSArray *annotations;

@end

List.m

#import "List.h"
#import "RSFM.h"
#import "AnnotationDetailView.h"
#import "DTCustomColoredAccessory.h"

@interface List ()

@end

@implementation List
{
    NSMutableArray *title;
    NSMutableArray *subtitle;
    NSMutableArray *displayItems;
    NSMutableDictionary *marketDictionary;
    NSMutableArray *farmMarkets;
    NSArray *keys;
    NSMutableArray *objects;
}

我在这一行收到了警告:

@implementation List

当我这样做时,什么也没发生。 - raginggoat
2个回答

11
你应该收到某种警告,因为 MKAnnotation 协议包含许多属性,并且协议中定义的属性从未支持自动合成。
要么从你所声明支持的列表中删除此协议,要么实现适当的属性/访问方法以满足规定的职责。

4
根据iOS文档,您需要在MKAnnotation协议中合成coordinate。不幸的是,编译器没有提供这些信息,尽管它似乎知道。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接