I am coding a few annotations into a project. I currently have 30 annotations and are growing. I am wondering if there is an easier way to create the annotation.h and annotation.m classes for each individual annotation.
Currently, in my map view controller, I create annotation objects and place them in an array that works well for me, but as you could imagine, there is a lot of code to manage it when you have tons of annotations, not to specify tons classes.
So, for example, one of the annotation classes looks like this:
Annotation.h:
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface Annotation : NSObject {
}
@end
Annotation.m:
#import "Annotation.h"
@implementation Annotation
-(CLLocationCoordinate2D)coordinate;
{
CLLocationCoordinate2D theCoordinate;
theCoordinate.latitude = -45.866416;
theCoordinate.longitude = 170.519931;
return theCoordinate;
}
-(NSString *)title
{
return @"Title";
}
-(NSString *)subtitle
{
return @"Subtitle";
}
-(void)dealloc
{
[super dealloc];
}
@end
CSV , , , , , , , -. - ?