i got this error while trying to initialize a Google Map with the iOS SKD with Objetive-c doing the code in the documentation https://developers.google.com/maps/documentation/ios-sdk/.
2016-06-10 08:42:24.585 XXXXXApp[11103:451806] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010b33ed85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010adb2deb objc_exception_throw + 48
2 CoreFoundation 0x000000010b23b23e -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 318
3 CoreFoundation 0x000000010b24d5bb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
4 UIKit 0x00000001094ff287 -[UIButton _intrinsicSizeWithinSize:] + 1478
5 UIKit 0x00000001091f11ad -[UIView(Geometry) sizeToFit] + 253
6 XXXXXApp 0x0000000105c23ba0 -[GMSUISettingsView init] + 425
7 XXXXXApp 0x0000000105bab236 -[GMSUISettings initWithMapView:vectorMapView:] + 222
8 XXXXXApp 0x0000000105b9b053 -[GMSMapView sharedInitWithServices:camera:forPlaces:] + 1930
9 XXXXXApp 0x0000000105b99fdc -[GMSMapView initWithFrame:camera:] + 124
10 XXXXXApp 0x0000000105b99e01 +[GMSMapView mapWithFrame:camera:] + 104
The line: [GMSMapView mapWithFrame:CGRectZero camera:camera] is where all fails.
- (void)viewDidLoad {
[super viewDidLoad];
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.868
longitude:151.2086
zoom:6];
GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = camera.target;
marker.snippet = @"Hello World";
marker.appearAnimation = kGMSMarkerAnimationPop;
marker.map = mapView;
self.view = mapView;
}
I tried this code in the --loadView-- method and the issue still continue.