iOS 6.0 in Sydney? No suburb for you!
Just discovered an interesting bug in the iOS CLGeocoder object.
At goCatch we use the reverse geocoder to get a good estimate of the passenger's pickup location, so having the passenger appear in the correct suburb is pretty important. When you get a response from the CLGeocoder you get the following fields:
@property (nonatomic, readonly) NSString *name; // eg. Apple Inc.
@property (nonatomic, readonly) NSString *thoroughfare; // street address, eg. 1 Infinite Loop
@property (nonatomic, readonly) NSString *subThoroughfare; // eg. 1
@property (nonatomic, readonly) NSString *locality; // city, eg. Cupertino
@property (nonatomic, readonly) NSString *subLocality; // neighborhood, common name, eg. Mission District
@property (nonatomic, readonly) NSString *administrativeArea; // state, eg. CA
@property (nonatomic, readonly) NSString *subAdministrativeArea; // county, eg. Santa Clara
@property (nonatomic, readonly) NSString *postalCode; // zip code, eg. 95014
@property (nonatomic, readonly) NSString *ISOcountryCode; // eg. US
@property (nonatomic, readonly) NSString *country; // eg. United States
@property (nonatomic, readonly) NSString *inlandWater; // eg. Lake Tahoe
@property (nonatomic, readonly) NSString *ocean; // eg. Pacific Ocean
The two that I am particularly interested in this case is locality and subLocality. Because we want to show the most relevant neighborhood to the taxi driver, we prefer subLocality over locality. This has worked fine right up until iOS 6. Unfortunately with the iOS 6 release, the API has started returning the two values reversed. So for Ultimo (suburb or neighborhood) in Sydney (city), we get back:
[locality Ultimo]
[subLocality Sydney]
[administrativeArea New South Wales]
I checked the same results for the mission district in San Francisco] and it is working fine. I guess Apple would have noticed if that area was similarly broken:
[locality San Francisco]
[subLocality Mission]
[administrativeArea California]
With the iOS 6 release we stated getting a lot of taxi drivers complaining about jobs coming up in "Sydney" as opposed to a specific suburb. Ouch!!
We have added an iOS 6 specific hack which swaps the values until Apple gets around to fixing the issue.
Permalink - Tags: Development,iPhone,iPad