Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto Property Synthesis Warning in Xcode 5 iOS 7

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
like image 331
raginggoat Avatar asked Sep 16 '13 19:09

raginggoat


2 Answers

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.

like image 50
Wain Avatar answered Nov 10 '22 08:11

Wain


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.

like image 4
BradS Avatar answered Nov 10 '22 08:11

BradS