所以我查看了Apple獲取用戶位置的示例代碼。這對我和它的顯示正確的位置很好。將zipcode輸入到文本字段
現在我想在我創建的名爲「zipCode」的文本框中顯示郵政編碼。我會怎麼做?
tryed:
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations {
CLLocation *location = [locations objectAtIndex:0];
NSLog(@"lat%f - lon%f", location.coordinate.latitude, location.coordinate.longitude);
zipCode.text = self.placemark.postalCode;
}
但沒有奏效。
您是否收到郵政編碼? –
不,我沒有。但我也不知道我怎樣才能在一個的NSLog顯示它 –