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

标签 ios objective-c warnings objc-protocol

我在使用 iOS 7 SDK 的 Xcode 5 中收到警告

Auto property synthesis will not synthesize property declared in a protocol

我在使用 iOS 6.1 SDK 的 Xcode 4 中没有收到此警告。有什么想法吗?

这是我的代码:

列表.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

列表.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

最佳答案

您应该收到某种警告,因为 MKAnnotation 协议(protocol)包含许多属性,并且协议(protocol)中定义的属性从未支持自动合成。

要么从您声称支持的列表中删除该协议(protocol),要么实现适当的属性/访问器方法来履行规定的职责。

关于ios - Xcode 5 iOS 7 中的自动属性综合警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18835799/

相关文章:

ios - UITabBarController 如何适应 VIPER 架构?

ios - Swift 按钮隐藏 fatal error : Array index out of range

ios - 如何在iOS中通过BLE获取设备的MAC

android - 如何在 Eclipse 中的 Android 项目中的代码旁边显示警告?

warnings - TYPO3:如何抑制弃用警告?

ios - 将保留对象分配给__unsafe_unretained变量,但是为什么它不崩溃?

objective-c - 破解 NSDocument 架构

objective-c - iOS-帧高不是按像素?

javascript - 你能消除来自外部js脚本的错误和警告吗?

ios - 通过返回类型填充 prepareForSegue 的 destinationViewController