开发者

How do I get the users location latitude and longitude?

I need to access the users location in this method contained in the mainViewController

-(void)loadAnnotations{
[mapView removeAnnotations:mapView.annotations];

CLLocatio开发者_如何转开发nCoordinate2D 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];
}

however the mainViewController is already set to

<fipsideViewControllerDelegate>

What should I add to the header file and the implementation file to poll the location Manager for the users current latitude and longitude?


In your other question I already told you how to get the location, so:

-[CLLocation coordinate]

It never hurts to look in the documentation before posting questions...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜