gpt4 book ai didi

ios - MKMapView 仅在测试时导致 EXC_BAD_ACCESS

转载 作者:行者123 更新时间:2023-11-28 18:55:51 25 4
gpt4 key购买 nike

仅在设备上测试时,我收到 EXC_BAD_ACCESS。当我运行应用程序时不会发生这种情况。我担心我的用户会遇到崩溃,即使我没有在不测试时遇到崩溃。任何人有任何想法为什么?它似乎与我的注释无关,因为我注释掉了注释的添加并且它仍然崩溃。

此外,它加载到 map 的第一个 View ,但是当我导航回我的收藏 View 时,然后返回到该 View 时它崩溃了。我的坐标似乎也有效,因为它通过了有效性检查。

        //////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//////////

最佳答案

我在这个问题上找到了解决我问题的答案。 UIWebView EXC_BAD_ACCESS crash .

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

关于ios - MKMapView 仅在测试时导致 EXC_BAD_ACCESS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33321305/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com