2012-09-27 5 views
0

나는 새로운지도 앱이 내가 만들고있는 앱에서 구현해야하는 기능을 가지고 있다는 것을 알아 차렸다. 이 기능은 사용자가 위치에 핀을 놓으면 주소가 주석보기의 부제목으로 표시됩니다. 누구든지 그 일을하는 방법을 알고 있습니까?주소를 가져 오는 MKAnnotation

답변

0

당신은 같은 사용자 정의 주석의 자막 속성을 구현해야합니다

// Geo.h 
#import <Foundation/Foundation.h> 

#import <CoreLocation/CoreLocation.h> 
#import <MapKit/MapKit.h> 

@interface Geo : NSObject <MKAnnotation> 

@property (nonatomic, strong) NSString* subtitle; 

// Geo.m 
#include "Geo.h" 

@implementation Geo 

- (NSString *)subtitle 
{ 
    return _subtitle; // Here you can reverse geocoding to get address from a CLLocationCoordinate2D object 
}; 
관련 문제