Hello, please could anybody help me, i don't know more.
i have programmed an app, which loads a lot of points in maps and show it.
but now the problem is how I can write a title an subtitle for each annotation?
this is the code for my class which sets up the annotations:
please help me, thanks
i have programmed an app, which loads a lot of points in maps and show it.
but now the problem is how I can write a title an subtitle for each annotation?
this is the code for my class which sets up the annotations:
Code:
#import "EarthquakeEventView.h"
@implementation EarthquakeEventView
- (id)initWithAnnotation:(id <MKAnnotation>)annotation
reuseIdentifier:(NSString *)reuseIdentifier {
if(self = [super initWithAnnotation:annotation
reuseIdentifier:reuseIdentifier]) {
self.backgroundColor = [UIColor clearColor];
}
return self;
}
- (NSString *)subtitle{
return @"Adresse";
}
- (NSString *)title{
return @"Name";
}
- (void)setAnnotation:(id <MKAnnotation>)annotation {
super.annotation = annotation;
if([annotation isMemberOfClass:[SeismicEvent class]]) {
event = (SeismicEvent *)annotation;
float magSquared = event.magnitude * event.magnitude;
self.frame = CGRectMake(0, 0, magSquared * .75, magSquared * .75);
} else {
self.frame = CGRectMake(0,0,0,0);
}
}
- (void)dealloc {
[event release];
[super dealloc];
}
@end
please help me, thanks