Questions tagged [clgeocoder]

The CLGeocoder class provides services for converting between a coordinate (specified as a latitude and longitude) and the user-friendly representation of that coordinate.

The CLGeocoder class provides services for converting between a coordinate (specified as a latitude and longitude) and the user-friendly representation of that coordinate. A user-friendly representation of the coordinate typically consists of the street, city, state, and country information corresponding to the given location, but it may also contain a relevant point of interest, landmarks, or other identifying information. A geocoder object is a single-shot object that works with a network-based service to look up placemark information for its specified coordinate value.

http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLGeocoder_class

227 questions
0
votes
1 answer

How to store data (into a global variable) retrieved from reverseGeocodeLocation() method (asynchronous task)?

First I have a global variable: var userCity : String? Using reverseGeocodeLocation() to obtain the city name from the user's location, I am trying to store that city name information into the userCity global variable. I know that you cannot…
0
votes
1 answer

Wrong coordinates are provided by the geocodeaddressString

When converting the string(place) into Coordinates. the coordinates that are in the placemark is pointing to the direction which is different from the string i provided as an argument. let address = "16/1, Kanchan Bagh Main Road, South Tukoganj,…
Ayush sharma
  • 169
  • 7
0
votes
1 answer

Why CLGeoCoder cannot get anything?

I have program a class that can reverse the location into the Geo-information like this: import Foundation import UIKit import CoreLocation public class Geocoder{ public static func Geocoder(latitudein:Double,longitudein:Double)->String { …
Z.Q
  • 103
  • 1
  • 1
  • 8
0
votes
1 answer

Return CLLocationCoordinate2D to struct

I'm new in programming and my question is how to return data of variables type CLLocationCoordinate2D to Coordinates i.e. type of a structure. Trying to develop a weather app. I have a struct: struct Coordinates { let latitude: Double let…
0
votes
1 answer

Request CLGeocoder.reverseGeocodeLocation synchronously

In our code, we call a method that supposedly returns the address of the current device's location from the CLGeocoder. But the problem is the CLGeocoder performs the request asynchronously and calls the completionHandler when it's done so there's a…
SquareBox
  • 823
  • 1
  • 10
  • 22
0
votes
1 answer

What rules do Moments album section headers follow

I'm trying to create a CollectionView that mimics the UI of the Moments album in the iOS Photos app. I'm very close to finishing it, but I'm struggling to figure out what rules Apple are using to create the label for each date/location section of…
0
votes
2 answers

how to get exact coordinates of given address using forward geocoding

In my application I want the exact lattitude and longitude of given address using forward geocoding in IOS in Objective-C. I had used forward geocoding in my application but it is not giving the exact address. this is my code of forward…
0
votes
0 answers

CLPlacemark causes app crash: object is NOT NIL

I ran into an extremely frustrating problem, and I've been struggling with this all afternoon, so please excuse me if I'm all little short in my explanation. My patience is at an extremely low level right now. I want to pass a CLPLacemark object…
Mark Carols
  • 403
  • 4
  • 20
0
votes
4 answers

If statement is not changing global variable swift

I am trying to set up a function to get my current location in app delegate but when I print(city) at the bottom it returns the original initialized value in the global variable which is "hello", even though I updated the value under the…
0
votes
1 answer

Using CLGeocoder inside class init()

I want to have a class that is able to get a country name using CLGeocoder. The code below doesn't work probably because variable country is assigned to self.country before CLGeocoder finishes running. What can I do so self.country actually gets the…
lukas
  • 579
  • 2
  • 8
  • 17
0
votes
1 answer

[__NSDictionaryI bytes]: unrecognized selector sent to instance

This is my code for getting postal code. CLGeocoder *reverseGeocoder = [[CLGeocoder alloc] init]; [reverseGeocoder reverseGeocodeLocation:locationManager.location completionHandler:^(NSArray *placemarks, NSError *error) { …
PREMKUMAR
  • 8,283
  • 8
  • 28
  • 51
0
votes
1 answer

Getting NSException while filling UICollectionView in Swift

In my code I'm calling the Apple geocoder: private func callGoogleReverseGeocodingWebservice(location: CLLocationCoordinate2D) { let geoCoder = CLGeocoder() let location = CLLocation(latitude: location.latitude, longitude:…
user3766930
  • 5,629
  • 10
  • 51
  • 104
0
votes
3 answers

Get Location name from reverseGeocodeLocation

I want to find out photos location using reverseGeocodeLocation. I use the below function @interface GalleryPhotosViewController () { CLPlacemark *placemark; } @end -(NSString *)getLocation:(CLLocation *)locations{ CLGeocoder *geocoder =…
sazid008
  • 175
  • 2
  • 14
0
votes
2 answers

iOS Display Alert Dependent On Country User In

In my app, I need to check the user's country, and then display an alert based on that. In the AppDelegate file, I have in didFinishLaunchingWithOptions: self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate =…
user717452
  • 33
  • 14
  • 73
  • 149
0
votes
1 answer

Location Lookup on Keystroke like Apple Weather app

I'd like to perform a location lookup like the Apple Weather app which shows a table of potential locations with each keystroke. I'm sending the user's input string to the function below each time an "editing changed" event occurs in the text field.…
Gallaugher
  • 1,593
  • 16
  • 27