MKMapView addAnnotation сбой с EXC_BAD_ACCESS

Здравствуйте, я вижу эту странную проблему, я заполняю свою собственную аннотацию для mkmapview в цикле for, после выполнения цикла for 54 раза, что происходит в 55-м раз, когда я добавляю mkmapview addannotation в этой строке, он выдает EXC_BAD_ACCESS вот код

- (void)viewDidLoad {

[super viewDidLoad];
[mkMapView setMapType:MKMapTypeStandard];
[mkMapView setZoomEnabled:YES];
[mkMapView setShowsUserLocation:YES];
[mkMapView setScrollEnabled:YES];

MKCoordinateRegion region;
region.center.latitude = currentLocation.latitude;
region.center.longitude = currentLocation.longitude;
MKCoordinateSpan span;
span.latitudeDelta = 0.03;
span.longitudeDelta = 0.03;
region.span = span;
[mkMapView setRegion:region animated:TRUE]; 
[mkMapView setDelegate:self];


int i =0;
for(MyObject* myObject in myObjectArray)
{
    NSLog(@"%d", i);
    if(i == 55){
        NSLog(@"%@", myObject);
    }
    i++;
    NSString *maintitle = myObject.name;
    NSString *subtitle = myObject.address;

    CLLocationCoordinate2D newCoordinate = { [myObject.latitude doubleValue], [myObject.longitude doubleValue] };
    Annotation *pinAnnotation = [[Annotation alloc]initWithCoordinate:newCoordinate title:maintitle subtitle:subtitle image:NULL];
    [mkMapView addAnnotation: pinAnnotation];
    [pinAnnotation release];
}
}

 - (void)dealloc {
mkMapView.delegate = nil;
[mkMapView release];
mkMapView = nil;
[myObjectArray release];
myObjectArray = nil;
[super dealloc];
 }

Вот код для Annotation.h

 @interface Annotation : NSObject <MKAnnotation>{
 CLLocationCoordinate2D    coordinate;
 NSString * title;
 NSString * subtitle;
 UIImage * image;
 }

 @property (nonatomic, readwrite, assign) CLLocationCoordinate2D    coordinate;
 @property (nonatomic, retain) NSString * title;
 @property (nonatomic, retain) NSString * subtitle;
 @property (nonatomic, retain) UIImage * image;

 - (id) initWithCoordinate:(CLLocationCoordinate2D) coordinate title:(NSString*) title subtitle:(NSString*) subtitle image:(UIImage*) image;

@end

Вот код для Annotation.m

 - (id) initWithCoordinate:(CLLocationCoordinate2D)coordinate title:(NSString*) title subtitle: (NSString*) subtitle image:(UIImage*) image{
self = [super init];
if(self){
self.coordinate = coordinate;
self.title = title;
self.subtitle = subtitle;
self.image = image;
}

return self;
}

-(void) dealloc{
[title release];
[subtitle release];
[image release];
[super dealloc];
}

вот stacktrace

0 MYAPP 0x00099c6a + [TFCrashHandler backtrace] + 46

1 MYAPP 0x0009a007 TFSignalHandler + 45

2 libSystem.B.dylib 0x9455345b _sigtramp + 43

3 ??? 0xffffffff 0x0 + 4294967295

4 MapKit 0x015f5124 - [MKQuadTrie содержит:] + 40

5 MapKit 0x0156363c - [MKAnnotationContainerView addAnnotation:] + 356

6 MapKit 0x015Map7 -

121 --- 1774350- Формат Spring: аргумент сообщения Как я могу отформатировать аргументы моего ? У меня есть такое сообщение: message.myMessage = это {0} мое сообщение {1} с {2} несколькими аргументами. В моем jsp есть следующее: <...

Как я могу отформатировать аргументы моего ?

У меня есть такое сообщение:

 message.myMessage=this is {0} my message {1} with {2} multiple arguments

Мой jsp имеет следующее:

<spring:message code="message.myMessage" 
                arguments="<fmt:formatNumber value='${value1}' currencySymbol='$' type='currency'/>,${value2},${value3}" 
                htmlEscape="false"/>

, который не отображает value1 , то есть число I хотел бы отформатировать.

Я не уверен, что могу добавить тег fmt в список аргументов.

15
задан skaffman 1 July 2011 в 17:05
поделиться