2012-09-21 4 views
0

위치의 이름이 아닌 사용자의 현재 위치의 경도와 고도를 가져올 수 있습니다. 나는 아래 userLocation 속성 사용 :NSLog에서 MapView의 현재 위치를 얻는 방법은 무엇입니까?

NSLog(@"Current location=%@",mapView.userLocation); 

을하지만, 그것은 나에게 내가 대신 0x1f59e8c0의 해당 위치의 문자열 값을 얻으려면 Current location=<MKUserLocation: 0x1f59e8c0>

로 출력을 제공합니다. 이 작업을 수행하는 방법?

답변

1

에있다 : http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapView_Class/MKMapView/MKMapView.html

당신은 경도가 CLLocationCoordinate2D의 일부입니다 찾을 체인을 따를 수 (이고 이중) http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CoreLocationDataTypesRef/Reference/reference.html#//apple_ref/doc/c_ref/CLLocationCoordinate2D

NSLog(@"Current longitude = %f",mapView.userLocation.location.coordinate.longitude); 
1
NSLog(@"Current location %@",mapView.userLocation.title); 

P. 거기 MKMapView 문서에서 시작 이상의 속성 자막

+0

그러나 , 이것은 나를 가치로 보았습니다, 현재 위치 = 현재 위치 – stack

관련 문제