0

Please note - I have checked through SO for an answer to this. Many developers have answered, however I feel I have done what was needed.

I added the -ObjC to the project: Other Linker Flags.

I keep getting this error:

NSInvalidArgumentException', reason: '-[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance

I have followed Googles steps - step by step as well as watching a number of videos (which are in ObjC) and reading a number of blogs.

I have added all frameworks and even unticked do not copy when adding the GMaps bundle.

Here is my code.

AppDelegate

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.


       Parse.enableLocalDatastore()
       Parse.setApplicationId("ParseKey_eOHadu2GEOBqxvRl8ijKM0PMhq3", clientKey: "ParseKey_yFjq2MWocV3188hOq9MIjhqi5x0Od")

        PFFacebookUtils.initializeFacebook()

        GMSServices.provideAPIKey("MyKey_Pq9rjt5ZFX_jpB_QF5pEarMdp18_x4")

    return true
}

Here is my viewController code

class UserLocationGm: UIViewController , GMSMapViewDelegate {

override func viewDidLoad() {
    super.viewDidLoad()

    var camera = GMSCameraPosition.cameraWithLatitude(-33.86,
        longitude: 151.20, zoom: 6)
    var mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
    mapView.myLocationEnabled = true
    self.view = mapView

    var marker = GMSMarker()
    marker.position = CLLocationCoordinate2DMake(-33.86, 151.20)
    marker.title = "Sydney"
    marker.snippet = "Australia"
    marker.map = mapView

    }

Is something missing? i.e. I'm fairly sure that I am not meant to add a MapKit View to the viewController. Has anyone got any suggestions?

Xcode 6 Google Maps SDK: 1.9.1 Lang: Swift

Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
Rogog
  • 11
  • 1
  • 3
  • possible duplicate of [GoogleMaps basic iOS demo app crash - unrecognized selector sent to instance](http://stackoverflow.com/questions/22019776/googlemaps-basic-ios-demo-app-crash-unrecognized-selector-sent-to-instance) – Paulw11 Jan 24 '15 at 13:03
  • It is similar to it and I have gone through it. However, I have done the following: 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. - This did not work – Rogog Jan 24 '15 at 13:19

0 Answers0