Вопрос

I'm getting a warning in Xcode 5 with the iOS 7 SDK that says

Auto property synthesis will not synthesize property declared in a protocol

I didn't get this warning in Xcode 4 with the iOS 6.1 SDK. Any ideas?

Here is my code:

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;
}

I'm getting the warning on the line:

@implementation List
Это было полезно?

Решение

You should have received some kind of warning because MKAnnotation protocol contains a number of properties and auto-synthesis has never been supported for properties defined in a protocol.

Either remove this protocol from the list you claim to support or implement appropriate properties / accessor methods to fulfil the stated responsibilities.

Другие советы

According to the iOS docs you need to synthesize coordinate in the MKAnnotation protocol. Unfortunately, the compiler doesn't give you this information, though it seems to know.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top