19593

How to reverse geocode the continent using CLGeocoder?

Question:

Surprisingly, I wasn't able to find ANY meaningfull information in 30 minutes of search in all the right places..it's suspicious, I think I am doing something wrong. I would add, that the solution should be without requiring third party code or webservices..

Answer1:

I actually wrote a category to address this caveat in the CLPlacemark class. It currently uses the -ISOCountryCode property to map it to its correspondent continent.

<a href="https://github.com/Hecktorzr/Transcontinental" rel="nofollow">https://github.com/Hecktorzr/Transcontinental</a>

Answer2:

How are you using the CLGeocoder at the moment. Without seeing some code not much we can suggest ...

However, if you are trying to get information on where the user is or where a location is you can use this:

{ CLLocationManager *location = [[CLLocationManager alloc] init]; [location setDelegate:self]; [location startUpdatingLocation]; [location setDesiredAccuracy:kCLLocationAccuracyBest]; CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder reverseGeocodeLocation:location.location completionHandler:^(NSArray *placemarks, NSError *error) { CLPlacemark *placemark = [placemarks objectAtIndex:0]; NSLog(@"%@ %@ %@ %@ %@ %@ %@ %@", placemark.country, placemark.ISOcountryCode, placemark.postalCode, placemark.administrativeArea, placemark.locality, placemark.subLocality, placemark.thoroughfare, placemark.subThoroughfare); [geocoder release]; [location release]; }]; }

Recommend

  • Delphi 2010 or 2007 for upgrading Delphi 3 project?
  • IOS: automatic reference counting
  • Does Accurev support stashing?
  • how to handle onLoad Event on img tag and others
  • Google cloud datastore emulator init data
  • TypeScript DefinitelyTyped Ember.js d.ts doesn't compile
  • How to remote debug with Delve debugger in Visual Studio Code
  • Scrolling News Ticker Jquery - Issues
  • Why do GeoJSON features appear like a negative photo of the features themselves?
  • RPMs for IDAS IoTAgents GE, from Fiware
  • Using extern @class in order to add a category?
  • “A GKScore must specify a leaderboard.”
  • Plotting Route with Multiple Points in iOS
  • Certain Arabic text gets incorrectly shown while other Arabic text gets showed normally?
  • iOS Localization Doesn't Work with More Than 63 Files
  • TFS - how do I sum child task hours to parent
  • .NET video play library which allows to change the playback rate?
  • ImportError: cannot import name Pubnub
  • How can we prepend rows to a react native list-view?
  • Detecting null parameter in preprocessor macro
  • How to get links to open in the native browser in iOS Meteor apps?
  • Application level floating views with navigation in Android
  • How to generate and display a QR Code in ionic 2
  • Database structure design with variable amounts of fields
  • Meteor: Do Something On Email Verification Confirmation
  • Cannot resolve symbol 'MyApi'
  • How to get address from latitude and longitude android google map v2 [duplicate]
  • How do I fake an specific browser client when using Java's Net library?
  • How to get a value (ex: baseURL) in every Karate feature?
  • Shallow update not allowed (git > 1.9)
  • Javascript convert timezone issue
  • How do I rollback to a specific git commit
  • Revoking OAuth Access Token Results in 404 Not Found
  • KeystoneJS: Relationships in Admin UI not updating
  • using HTMLImports.whenReady not working in chrome
  • Java static initializers and reflection
  • unknown Exception android
  • Checking variable from a different class in C#
  • Observable and ngFor in Angular 2
  • Unable to use reactive element in my shiny app