Thursday, December 6, 2012

[iOS] Get current location and city name


1. Add CoreLocation.framework to your project

2. Add CLLocationManagerDelegate to your viewController

3. Initialize CLLocationManager in viewDidLoad

4. Get current location in  the delegate method
- (void)locationManager:(CLLocationManager*)managerdidUpdateLocations:(NSArray*)locations;

5. Use CLGeocoder to reverseGeocodeLocation

Full Code here

No comments:

Post a Comment