You need to create a MKUserTrackingBarButtonItem and pass it the MKMapview in the constructor, then add that button item to the navigation menu (or where ever it is your button should be).
- (void)viewDidLoad
{
[super viewDidLoad];
MKUserTrackingBarButtonItem *buttonItem = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.map];
self.navigationItem.rightBarButtonItem = buttonItem;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…