In iOS development, the use of positioning often encountered this headache problem: The system language in English when the return of English or pinyin, the system language is Chinese when the return to Chinese.
The following is a mandatory system to obtain the location of the location for Chinese. The scheme is online, but it is optimized to restore the system language after the inverse geocoding is complete, avoiding some extreme cases of non-effective issues.
measurement is feasible. Please leave a message if you have questions.
`
-(void) Locationmanager: (Cllocationmanager *) Manager didupdatetolocation: (cllocation *) newlocation fromlocation: ( Cllocation *) oldlocation{//Get latitude and longitude NSLog (@ "Latitude:%f", newLocation.coordinate.latitude); NSLog (@ "Longitude:%f", newLocation.coordinate.longitude); Stop location update [manager Stopupdatinglocation]; Save the current language of the Device (English, French,,,) nsmutablearray *userdefaultlanguages = [[Nsuserdefaults standarduserdefaults] Objectfo rkey:@ "Applelanguages"]; Force into Simplified Chinese [[nsuserdefaults standarduserdefaults] Setobject:[nsarray arraywithobjects:@ "Zh-hans", Nil] forKey:@ "Ap Plelanguages "]; Inverse geocoding Clgeocoder * GeoCoder = [[Clgeocoder alloc] init]; [GeoCoder reversegeocodelocation:newlocation completionhandler:^ (Nsarray *placemarks, Nserror *error) {if (!error) {for (Clplacemark * Placemark in Placemarks) {nsstring *cityname = [Placema RK locality]; NSLog (@ "cityname==="%@ ", cityname);//You can see the output as Chinese break; } }//Restore device's language [[Nsuserdefaults standarduserdefaults] setobject:userdefaultlanguages forkey:@ "Apple Languages "]; }];}
`
iOS Development GPS location designated language return Chinese location