PruitIgoe
PruitIgoe

Reputation: 6384

Google Maps: unrecognized selector sent to instance error:

I've looked at a couple of other SO post on this and checked what they suggested but I am still getting a crash when I try to instantiate a Google Map.

In my build settings I have Other Linker Flags for debug and release set to -Objc

In my viewcontroller where the map will be instantiated I am importing the Google Maps framework and have this code:

GMSCameraPosition* cameraPosition = [GMSCameraPosition cameraWithLatitude:self.currentLocation.latitude
                                                                    longitude:self.currentLocation.longitude
                                                                         zoom:10];

    self.myMapView = [GMSMapView mapWithFrame:CGRectZero camera:cameraPosition];
    self.view = self.myMapView;

And I am getting this debugger output on the crash:

-[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance 0x7cdf6680

Other Linker Flag seems to be the main culprit for this crash but is there something else that could cause it?

Edit:Should note this crashes with CGRectZero or if I use self.view.bounds for the rect.

Edit: Switching -Objc to -ObjC created a linker error:

linker command failed with exit code 1 (use -v to see invocation)

Upvotes: 0

Views: 768

Answers (1)

Harika Jetti
Harika Jetti

Reputation: 51

Try opening the project.xcworkspcae, and run it again.

Upvotes: -1

Related Questions