2013-03-28 1 views

답변

1

.. ..

후 .. 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/

입니다 너 .. ..

+0

@vishnu 튜토리얼과 함께이 링크를 참조하십시오 .. http://www.edumobile.org/iphone/miscellaneous/how-to-get-current-latitude-and-longitude-in-iphone/ :) –

+0

paras joshi. u pls 나를 도울 수 있습니다. 나는 현재 위치를 가져올 수 없습니다 ... 나는 현재 위치를 기본값으로 tableview 필요합니다. – vishnu

+0

@vishnu 현재 위치에 넣으시겠습니까 ??? –

관련 문제