2013-06-13 54 views
0

我正在使用mapview。当我放大地图时,它显示确实收到了内存警告,并在iOS 6设备中崩溃了应用程序,但它在以下版本中工作正常。其采取更多的内存,当我放大,但其没有得到释放如何释放它,我haved释放的释放方法中的所有对象,但它仍然显示相同确实收到内存警告和崩溃的应用程序 我的代码是放大Mapview在iOS6上崩溃应用

 mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)]; 
    mapView.showsUserLocation = YES; 
    [mapView setDelegate:self]; 
    [self addSubview:mapView]; 
    routeView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, mapView.frame.size.width, mapView.frame.size.height)]; 
    routeView.userInteractionEnabled = NO; 
    [mapView addSubview:routeView]; 

     - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation 
    { 
     if([annotation isKindOfClass:[TurnAnnotation class]]) 
{ 
    MKAnnotationView *turnAnnotationView=[[MKAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:nil] ; 
    turnAnnotationView.image=[UIImage imageNamed:@"TurnAnnotation1.png"]; 

    turnAnnotationView.canShowCallout=NO; 
    return turnAnnotationView; 
} 
else if([annotation isKindOfClass:[PlaceMark class]]) 
{ 
    MKPinAnnotationView *newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil]; 

    if (isdefault==YES) { 
     if(!appDel.appBOOL){ 
      newAnnotation.pinColor = MKPinAnnotationColorGreen; 
      appDel.appBOOL = YES; 
     }else { 
      newAnnotation.pinColor = MKPinAnnotationColorRed; 
      appDel.appBOOL = NO; 
     } 
    }else{ 


    if(!appDel.appBOOL){ 
     newAnnotation.pinColor = MKPinAnnotationColorRed; 
     appDel.appBOOL = YES; 
    }else { 
     newAnnotation.pinColor = MKPinAnnotationColorGreen; 
     appDel.appBOOL = NO; 
    } 
    } 

    newAnnotation.canShowCallout = YES; 

    return newAnnotation; 
} 
return nil; 

}

回答

0

难道你的iOS6测试用例是Retina版本吗?视网膜图像占用4倍的内存。内存不足警告不应该被忽略。