2012-11-22 115 views
6

我在我的专用于iPad(iOS6)的应用程序中使用Google地图时出现了一个奇怪的问题。我做了一个水平滚动视图,充满了两个视图。一个是详细信息视图(一些文本,没有什么特别),第二个视图是一个带有Google地图的视图控制器。这是我的应用程序中的通用方案(从两个视图构建的scrollview)出于几个不同的目的。当我开始使用iOS6在真正的iPad上测试应用程序时,就会出现问题。当它应该查看滚动视图时,应用程序崩溃。但不是立即。开始时,正确查看滚动视图。然后我想用新数据构建一个新的滚动视图。它也很好,并正确查看滚动视图。之后一样,我已经开始receiveing越来越多的错误日志少数像这样的操作:在iOS6上使用MapKit崩溃的应用程序

failed to make complete framebuffer object 8cdd

滚动视图,没有任何额外的错误应用程序崩溃的几个运行后。在main.m文件代码编辑器点,下面一行:

int retVal = UIApplicationMain(argc, argv, nil, nil);

请直接与我找到我在做什么错。其中从我的视图控制器viewDidLoad方法负责查看谷歌地图:

-(void)viewDidLoad { 
mapView.mapType = MKMapTypeSatellite; 
mapView.showsUserLocation = YES; 

/* ANNOTATION (pin) */ 

CLLocationCoordinate2D annotationCoord; 

annotationCoord.latitude = [self.restaurant.latitude doubleValue]; 
annotationCoord.longitude = [self.restaurant.longitude doubleValue]; 

// a pin with the info. 

MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init]; 

annotationPoint.coordinate = annotationCoord; 
annotationPoint.title = self.restaurant.name; 

// add annotation to the map 

    [mapView performSelectorOnMainThread:@selector(addAnnotation:) 
            withObject:annotationPoint 
            waitUntilDone:YES]; 


[annotationPoint release]; 

MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance (annotationCoord, 500, 500); 
[self.mapView setRegion:region animated:YES]; 

[super viewDidLoad]; 
} 

,没有母校我是如何推动与谷歌地图的视图的视图控制器。它总是死机我的应用程序:(I`ve试过这样:

[scrollView addSubview:self.googleMapViewController.view]; 

,或者:

[[self navigationController] pushViewController:self.googleMapViewController animated:YES]; 

当我运行模拟器上的应用,可以去看一切都好我。使用XCode 4.5.1

回答

0

我在我的一个项目中遇到了同样的问题,它是由内存泄漏导致的,如果不删除它们,Map视图会占用大量内存,它不会出现在模拟器上因为一台电脑可以使用更多的内存。 只要确保摆脱了地图视图,当你不再需要它们。 我也建议使用Instruments(Leaks)运行应用程序 - 在这种情况下它是一个非常有用的工具。

相关问题