MKMapKit问题Xcode 7发布

时间:2015-09-19 20:44:36

标签: objective-c xcode ios9

我面临的问题是我的应用程序冻结了地图在视图上显示的位置。 Xcode只会在应用程序死机时生成错误或崩溃。在模拟器和真实设备上。我发现问题因为MKMapview而持续存在,因为我将其从我的子视图应用程序中删除了。

有人可以帮我确定这个问题的根本原因。

@property (strong, nonatomic) MKMapView *mapView;
@synthesize mapView;


self.mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
[self.mapView addAnnotation:annotationPoint];
self.mapView.delegate = self;
self.mapView.userInteractionEnabled=YES;
self.mapView.showsUserLocation=YES;
self.mapView.scrollEnabled=YES;
 self.mapView.zoomEnabled=YES;
[self.view addSubview:self.mapView];
[self.mapView setCenterCoordinate:fromAddress animated:NO];

[self.mapView   setCenterCoordinate:CLLocationCoordinate2DMake(annotationCoord.latitude, annotationCoord.longitude) animated:NO];
 [self.mapView regionThatFits:region];

1 个答案:

答案 0 :(得分:0)

此问题的解决方案是,将地图视图作为子视图直接添加到视图中会产生问题。所以我添加了一个Table视图作为视图的子视图,并添加了map视图作为tableview的背景视图。工作