6

I have a strange problem with google map in my application dedicated for iPad (with iOS6). I've made a horizontal scroll view, filled with two views. One is a detail information view (some text, nothing special), and the second view is a view controller with google map. This is the universal scheme in my application (scrollview build from two views) for a few different purposes. The problem occurs when I've started to test the app on a real iPad with iOS6. The application crash when it should view a scroll view. But not immediatly. At start, scroll view is viewed properly. Then I want to build a new scroll view with new datas. It also goes fine, and scroll view is viewed properly. After a few operation like that I've start to receiveing more and more error logs like this:

failed to make complete framebuffer object 8cdd

After a few runs of scrollView, the application crash without any additional errors. Code editor points on main.m file, and the following line:

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

Please direct me to find what am I doing wrong. Where is the viewDidLoad method from my view controller responsible for viewing the google map:

-(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];
}

and no mater how I push the view controller with google map to the view. It always crash my app :(. I`ve tried like this:

[scrollView addSubview:self.googleMapViewController.view]; 

or that:

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

When I run the application on simulator, there`s everything all right. I'm using XCode 4.5.1.

Marx Dzida
  • 61
  • 3

1 Answers1

0

I had the same problem in one of my projects. It was caused by a memory leak. Map views consume alot of memory if you don't delete them. It doesn't appear on simulator because a computer can use much more memory. Just make sure to get rid of the map views when you no longer need them. I also recommend running the app with Instruments (Leaks) - it is an extremely useful tool in such cases.

robbartoszewski
  • 896
  • 6
  • 11