I am new to iOS Programming and I have downloaded the google maps sdk for iOS and followed the instruction on their website ( as shown in this link https://developers.google.com
I faced the same issue and the fix is very easy, just override this UIViewController
method:
-(void) viewWillAppear:(BOOL)animated
and put your UIButton
creation logic inside that method.
Example:
-(void) viewWillAppear:(BOOL)animated
{
locationButton = [UIButton buttonWithType:UIButtonTypeCustom];
locationButton.frame = CGRectMake(0, 30, self.view.frame.size.width/6, self.view.frame.size.height/6);
[locationButton setImage:[UIImage imageNamed:@"location_enabled.png"] forState:UIControlStateNormal];
[self.view addSubview:locationButton];
}