Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8127733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:38:03+00:00 2026-06-06T07:38:03+00:00

I’m able to retrieve the current location in my iPad application using, CLLocation *location

  • 0

I’m able to retrieve the current location in my iPad application using,

CLLocation *location = [[CLLocation alloc] initWithLatitude:[latitude floatValue]   longitude:[longitude floatValue]];
    CLGeocoder *geocoder = [[CLGeocoder alloc] init];

    [geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error)
     {

         NSLog(@"-----------------Placemark is %@-----------------", placemarks);

          locationLabel.text = placemarks;

     }];

and the output is,

-----------------Placemark is ("South Atlantic Ocean, South Atlantic Ocean @<-42.60533670,-21.93128480> +/- 100.00m,    region (identifier <-41.51023865,-31.60774370> radius 4954476.31) <-41.51023865,-31.60774370> radius 4954476.31m"
)-----------------

Can I use the same information to just get the city and the country name? instead of the long list of information?

also, the ‘locationLabel.text = placemarks’ gives a warning, “Incompatible pointer types assigning to ‘NSString*’ from ‘NSArray*_strong’, which I’m unable to resolve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:38:05+00:00Added an answer on June 6, 2026 at 7:38 am

    Yes you can.
    But you doing it a little it wrong. First of all, placemarks is an array and not a string. That’s why locationLabel.text = placemarks gives a warning.

    Placemarks is an array of CLPlacemarks. This is because the geocoder could return multiple results for a coordinate. In the simplest condition the first item in it should be okay.

    A CLPlacemark has the property addressDictionary which contains the data of this location.
    You can access this data with the address property constans defined by the ABPerson header file.

    For example:

    Get the first placemark from the array:

    CLPlacemark *place = [placemarks objectAtIndex:0];
    

    then get the city from this placemark:

    NSString *cityName = [place objectForKey: kABPersonAddressCityKey];
    

    Don’t forget to import the AVPerson header!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
Thanks in advance for your help. I have a need within an application to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.