Search code examples
ios8google-maps-sdk-ios

google map ios sdk: could not get current user location?


self.mapView.myLocationEnabled = true
println("ml")
println(mapView.myLocation)

I got nil for mapView.myLocation and I'm using an iPod for testing not an emulator. The iPod's 'location services' is on.

I'm using xcode 6 beta 5 and targeting ios 8.


Solution

  • The main reason is I need to declare NSLocationWhenInUseUsageDescription in info.plist for ios 8. Then everything else works!