【发布时间】:2023-04-10 12:48:01
【问题描述】:
所以我查看了 Apple 的示例代码,用于获取用户位置。这对我来说很好,它的显示位置是正确的。
现在我想在我创建的名为“zipCode”的文本字段中显示邮政编码。我该怎么做?
试过了:
- (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 中显示它
标签: iphone objective-c ios uitextfield location