【发布时间】:2011-05-20 14:20:13
【问题描述】:
我是 obj-c 和 iOS 编程的新手。 所以在一个文件/模块中我编写了 GPS+地图,在这个文件/模块中我更新了我的地理位置。 在另一个文件/模块中,我有函数将第一个文件/模块的地理位置作为 CLLocationCoordinate2D var。有小代码部分可以解释我的意思。 GPS+地图文件中的一些功能是:。
-(void)mapView:(MKMapView *)mv didUpdateUserLocation:(MKUserLocation *)userLocation {
if (AnotherModuleGeolocTaker!=nil)
[[AnotherModuleGeolocTaker getInstance] setLocation:[userLocation coordinate]];
...
有地理定位。二传手。在另一个文件/module.h:.
...
@property (nonatomic, assign) CLLocationCoordinate2D location;
...
在另一个文件/module.m:.
...
@synthesize location;
...
- (IBAction)ThereIsGeolocTakeAction:(id)sender {
NSLog(@"\n\nlatitude = %g\n\tlongitude = %g",location.latitude,location.longitude);
...
那么如何将坐标从 'didUpdateUserLocation' 发送到 'ThereIsGeolocTakeAction' ?
【问题讨论】:
标签: objective-c xcode ios geolocation