1
현재 위치를 가리키는 데 사용됩니다. 이제는 textfield 또는 tableview에서 현재 위치 세부 정보를 얻으려고하므로 아무도 알지 못하면 도와주세요.in MKMapkit 텍스트 위치 또는 테이블 뷰에서 현재 위치 정보를 얻는 방법
이먼저 .h
파일에 MKReverseGeocoderDelegate
추가 내가 울부 짖는 코드를 사용했다
현재 위치를 가리키는 데 사용됩니다. 이제는 textfield 또는 tableview에서 현재 위치 세부 정보를 얻으려고하므로 아무도 알지 못하면 도와주세요.in MKMapkit 텍스트 위치 또는 테이블 뷰에서 현재 위치 정보를 얻는 방법
이먼저 .h
파일에 MKReverseGeocoderDelegate
추가 내가 울부 짖는 코드를 사용했다
.. ..
후 .. belolow 같은 .h
파일에
MKReverseGeocoder *mkReverseGeocoder;
을 MKReverseGeocoder
의 객체를 생성 한 후 사용 좋아해요. UIButton
액션 이벤트
-(IBAction)btnFindMe_Clicked:(id)sender{
if(mkReverseGeocoder)
{
[mkReverseGeocoder autorelease];
}
mkReverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:[currLocation coordinate]];
[mkReverseGeocoder setDelegate:self];
[mkReverseGeocoder start];
}
이 우는 방법은 또한 MKReverseGeocoder
//mkreversegeocoder protocol methods
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{
[appDelegate hideLoadingView];
UIAlertView *alt=[[UIAlertView alloc]initWithTitle:@"Error" message:@"Try Again After Sometime" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alt show];
[alt release];
// NSLog(@"\n\n Error is %@",[error description]);
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
[appDelegate hideLoadingView];
NSLog(@"\n\n Address Dict : %@",[[placemark addressDictionary] description]);
txtCity.text=[[placemark addressDictionary] objectForKey:@"City"];
txtState.text=[[placemark addressDictionary] objectForKey:@"State"];
txtAddress1.text=[[placemark addressDictionary] objectForKey:@"Street"];
txtAddress2.text=[[placemark addressDictionary] objectForKey:@"SubLocality"];
//[NSString stringWithFormat:@"%@", [[gpsTextView addressDictionary] description], ];
}
예를 들어이 링크하지만 다른 코드를 참조의 위임 방법이 있습니다 .. 위의 내 사용자 지정 코드 ... 난이 도움 바랍니다 how-to-get-current-latitude-and-longitude-in-iphone/
입니다 너 .. ..
@vishnu 튜토리얼과 함께이 링크를 참조하십시오 .. http://www.edumobile.org/iphone/miscellaneous/how-to-get-current-latitude-and-longitude-in-iphone/ :) –
paras joshi. u pls 나를 도울 수 있습니다. 나는 현재 위치를 가져올 수 없습니다 ... 나는 현재 위치를 기본값으로 tableview 필요합니다. – vishnu
@vishnu 현재 위치에 넣으시겠습니까 ??? –