I have a warning in my custom class for the MKAnnotation.
In iOS 5.0, apple add a new readonly property, the title in the MKAnnotation class, but I already have this property in my custom MKAnnotation.
Then, how can I set the title in the MKAnnotation?
Interest link: http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKAnnotation_Protocol/Reference/Reference.html
And here is my code for iOS less than 5.0:
// in MyMKAnnotation.h
@interface MyMKAnnotation : NSObject <MKAnnotation>
{
CLLocationCoordinate2D coordinate;
}
@property (nonatomic, retain) NSString *title;
// in MyMKAnnotation.m
- (id) initWithTitle:(NSString *)_title:(NSString *)_title localizacion:(CLLocationCoordinate2D)_localizacion
{
coordinate = _localizacion;
title = _title; //-----------> here is taking the warning
return self;
}
Than you!! 🙂
With @Lefteris help, I write this code:
Thank you very much!! 🙂
BASED IN: Why after upgrading to Xcode 4.2 does MKAnnotation display a warning