1
var camera: GMSCameraPosition = GMSCameraPosition.cameraWithLatitude(-33.86, longitude: 151.20, zoom: 6); 
var gmaps: GMSMapView = GMSMapView.mapWithFrame(CGRectZero, camera:camera);

gmaps.myLocationEnabled = true

gmaps.delegate = self

self.view=gmaps

I got this error :

2014-08-15 17:22:43.749 MapTest[1579:60b] -[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance 0x17dbf550

2014-08-15 17:22:43.756 MapTest[1579:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance 0x17dbf550'

modusCell
  • 13,151
  • 9
  • 53
  • 80
Kamlesh Delat
  • 128
  • 11

2 Answers2

2

Setting flag on the project, rather than a specific target causes this error. Take a look inside GoogleMapsSDKDemos Project Settings to see that flag is set on the target rather then the project

Joanna
  • 21
  • 2
1

I just reproduced the problem of an unrecognised selector being sent to my instance by taking the -ObjC linker flag out of my working Google Maps Swift project. Although mine was for a different selector, I'd still guess that the answer for Swift is the same as earlier answers for Objective C code. Make sure to follow this step of Google's instructions carefully, setting the flag on the Project, not the individual target:

Choose your project, rather than a specific target, and open the Build Settings tab. In the Other Linker Flags section, add -ObjC. If these settings are not visible, change the filter in the Build Settings bar from Basic to All.

(If that's not the problem, did you check through the existing questions on the subject? If so, which of those answers have you tried?)

Community
  • 1
  • 1
Matt Gibson
  • 37,886
  • 9
  • 99
  • 128