仅当testing时MKMapView导致EXC_BAD_ACCESS

当只在设备上testing时,我得到了EXC_BAD_ACCESS。 当我刚刚运行应用程序时,这不会发生。 我担心我的用户会遇到崩溃,即使我不是在testing时。 任何人有任何想法为什么? 这似乎与我的注释没有关系,因为我注释了注释的添加,它仍然崩溃。

此外,它加载在地图的第一个视图,但是当我回到我的集合视图,然后回到这个视图是当它崩溃。 我的坐标似乎也是有效的,因为它通过了有效性检查。

//////THIS IS ALL THE MAP VIEW STUFF...... self.mapView.delegate = self; self.mapView = [[MKMapView alloc] initWithFrame:CGRectMake(17, 650, 733, 300)]; self.mapView.scrollEnabled = NO; self.mapView.zoomEnabled = NO; self.mapView.showsUserLocation = YES; CLLocationCoordinate2D location; NSMutableArray *newAnnotations = [NSMutableArray array]; MKPointAnnotation *newAnnotation; location.latitude = [[_selectedCategoryItem objectForKey:@"latitude"]doubleValue]; location.longitude = [[_selectedCategoryItem objectForKey:@"longitude"]doubleValue]; NSLog(@"Latitude ==> %f", [[_selectedCategoryItem objectForKey:@"latitude"]doubleValue]); NSLog(@"Longitude ==> %f", [[_selectedCategoryItem objectForKey:@"longitude"]doubleValue]); newAnnotation = [[MKPointAnnotation alloc] init]; newAnnotation.coordinate = location; MKCoordinateRegion region; MKCoordinateSpan span; span.latitudeDelta = 0.10; span.longitudeDelta = 0.10; region.span = span; region.center = location; if (CLLocationCoordinate2DIsValid(location)) { NSLog(@"place has VALID coordinates"); [newAnnotations addObject:newAnnotation]; [self.mapView addAnnotations:newAnnotations]; } else { NSLog(@"place has INVALID coordinates"); } [self.mapView setRegion:region animated:TRUE]; [self.m_ScrollView addSubview:self.mapView]; /////END ALL THE MAP VIEW STUFF////////// 

我在这个问题上find了解决我的问题的答案。 UIWebView EXC_BAD_ACCESS崩溃 。

产品 – >编辑scheme – >运行 – >选项 – >将GPU帧捕获设置为禁用。