Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps iOS SDK crash

I use google maps iOS SDK with storyboard. Application starting with Navigation View Controller that has a Root View Controller with map.

@implementation MyViewController
@synthesize btnMyLock;
@synthesize btnNearby;

GMSMapView *mapView_;
- (void)viewDidLoad
{
    [super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:20
                                                        longitude:20
                                                             zoom:0];

     mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
     mapView_.myLocationEnabled = YES;

     self.view = mapView_;
     // Creates a marker in the center of the map.
     GMSMarker *marker = [[GMSMarker alloc] init];
     [marker setIcon:[UIImage imageNamed:@"pin"]];
     marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
     marker.title = @"Sydney";
     marker.snippet = @"Australia";
     marker.map = mapView_;

     mapView_.settings.compassButton = YES;

     [mapView_ addSubview:btnMyLock];
     [mapView_ addSubview:btnNearby]; 
}

Button btnMyLock push the Table View Controller. In iOS 7 it's ok. But iOS 6 my app crashes. Sometimes crash with EXC_BAD_ACCESS (code=1) or code=2

like image 685
Bogdan Korda Avatar asked Jan 31 '26 12:01

Bogdan Korda


1 Answers

Problem that I used Autolayout view.

like image 155
Bogdan Korda Avatar answered Feb 02 '26 04:02

Bogdan Korda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!