Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

marcomn

macrumors newbie
Original poster
Dec 8, 2009
1
0
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:

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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.