【发布时间】:2010-06-17 22:10:06
【问题描述】:
我需要在 mainViewController 中的这个方法中访问用户位置
-(void)loadAnnotations{
[mapView removeAnnotations:mapView.annotations];
CLLocationCoordinate2D workingCoordinate;
workingCoordinate.latitude= //here i need the users latitude
workingCoordinate.longitude= //here i need the users longitude
NSLog(@" this is %@", workingCoordinate.latitude);
iProspectLiteAnnotation *tempMine = [[iProspectLiteAnnotation alloc] initWithCoordinate:workingCoordinate];
[tempMine setTitle:@"Present Location"];
[tempMine setAnnotationType:iProspectLiteAnnotationTypeUser];
[mapView addAnnotation:tempMine];
}
但是 mainViewController 已经设置为
<fipsideViewControllerDelegate>
我应该在头文件和实现文件中添加什么来轮询位置管理器以获取用户当前的经纬度?
【问题讨论】:
标签: objective-c iphone-sdk-3.0 core-location