- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{
self.mapAddress = @"";
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
NSString *str = [NSString stringWithFormat:@""];
str = [str stringByAppendingFormat:@"%@", placemark.country];
if([placemark.administrativeArea length] > 0)
{
str = [str stringByAppendingFormat:@" "];
str = [str stringByAppendingFormat:@"%@", placemark.administrativeArea];
}
if([placemark.subAdministrativeArea length] > 0)
{
str = [str stringByAppendingFormat:@" "];
str = [str stringByAppendingFormat:@"%@", placemark.subAdministrativeArea];
}
if([placemark.locality length] > 0)
{
str = [str stringByAppendingFormat:@" "];
str = [str stringByAppendingFormat:@"%@", placemark.locality];
}
if([placemark.subLocality length] > 0)
{
str = [str stringByAppendingFormat:@" "];
str = [str stringByAppendingFormat:@"%@", placemark.subLocality];
}
if([placemark.thoroughfare length] > 0)
{
str = [str stringByAppendingFormat:@" "];
str = [str stringByAppendingFormat:@"%@", placemark.thoroughfare];
}
if([placemark.subThoroughfare length] > 0)
{
str = [str stringByAppendingFormat:@" "];
str = [str stringByAppendingFormat:@"%@", placemark.subThoroughfare];
}
self.mapAddress = str; // 최종 주소
}
- (IBAction)moveCurrent:(id)sender
{
MKReverseGeocoder *everseGeocoder = [[[MKReverseGeocoder alloc] initWithCoordinate:위도경도로케이션] autorelease];
reverseGeocoder.delegate = self;
[reverseGeocoder start];
}
'iOS Programming' 카테고리의 다른 글
아이폰sdk에서 내가 만든 delegate로 파라미터 잔송하기 (0) | 2010.09.10 |
---|---|
아이폰SDK에서 첨부파일 포함하여 밀티파트 폼포스트로 웹전송하기 (0) | 2010.09.10 |
아이폰 sdk 로 간단한 트윗 날리기 (0) | 2010.09.10 |
Multiline UILabel의 수직 정렬 (Top / Center / Bottom) (0) | 2010.09.10 |
애니메이션효과로 탭바 숨기고 보이기 (0) | 2010.09.10 |