2012-09-20 1 views
5

iOS 6지도로 옮기는 데 문제가 없었습니다. 그러나 어떤 이유로, Detail Disclosure Button이 현재 내지도 App에 없습니다. 이것을 다시 얻을 수있는 방법이 있습니까? 와우, 완전히 예상치 못한. 이것은 수년간 일해 왔기 때문에 모든 대의원은 괜찮습니다.iOS6지도, 모든지도에서 Detail Disclosure Button (파란색 쉐브론)을 놓치지 마세요! 다시 얻는 방법

#pragma mark MKMapViewDelegate 
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { 

MKPinAnnotationView *pin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"REUSEME"] autorelease]; 
UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; 

if ([annotation isKindOfClass:[MKUserLocation class]]) { 
    pin.animatesDrop = YES; 
    return nil; 
} else { 
    [pin setPinColor:MKPinAnnotationColorGreen]; 
} 

pin.rightCalloutAccessoryView = button; 
pin.animatesDrop = YES; 
pin.canShowCallout = YES; 

return pin; 
} 
+0

나뿐만 아니라이 있어요. 앱을 조금만 실행하면 화면 밖으로 핀이 확대되고 다시 콜 아웃이 작동합니다. 호환성에 버그가 있지만 문제를 해결할 수있는 주문 문제가 있어야합니까? 내가 찾으면 답을 게시 할 것입니다! – sradforth

답변

0

내가 먼저 큐에서 제거하려고으로 내가 코드 사이에서 볼 수있는이 문제와 유일한 차이점이 없어 광산이 MKPinAnnotationPinView 객체의 생성에 있습니다

MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"CustomPinAnnotationView"]; 
0

I을 동일한 문제가 있으며 첫 번째 대답과 동일한 코드를 사용합니다.

MKPinAnnotationView * MyPin = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier : @ "MyPin"];

는 또한 4.5/아이폰 OS 나 아이폰 OS 6 mapKit에 나타났습니다 무엇 6.

0

은 타이밍이 중요하다는 것이다 엑스 코드 업데이트하기 때문에 다른 문제가 나타났습니다. MKMapView의 델리게이트를 late (즉, viewDidLoad)로 설정하면지도에 이미 추가 된 주석에 기본 주석 스타일이 사용됩니다. 나를위한 해결책은 mapView.delegate = self를 - (void) loadView 메소드로 이동하는 것이 었습니다.

0

@ErCa iOS 설명서에 따라 사용자 정의보기를 작성하지 않는 한 loadView를 호출하면 안됩니다.

문제는 다른 곳에 있습니다. 나는 그것을 가지고 있으며 그것을 찾으면 답을 게시 할 것입니다.

@ ed-potter iOS4를 타겟팅하고 있습니까? 내가 ARC와 함께 필요하지 않은 MKPinAnnotationView를 autorelease하기 때문에 묻고있다.

0

이것은 나에게도 일어난 일입니다. 어떤 이유로 MKMapView 대리자를 viewDidLoad보다 먼저 설정해야하는 것은 사실입니다. 내가 한 일은 내 setMapView : function 내에서 mapView 대리자를 설정하는 것입니다. MKMapView를 포함하는 뷰 컨트롤러에 대한 그래서

, 나는 다음과 같은 특성이 있었다 :

@property (비 원자, 약한) 함께 IBOutlet MKMapView *지도보기를; 나는이 같은 문제와 설정했다 (MKMapView *)지도보기 {

_mapView = mapView; 

self.mapView.delegate = self;//needed to move setting of the mapView delegate here because they changed when the viewForAnnotations delegate function is called when Apple went to iOS 6 and changed the maps App. Now all of the annotations are loaded and the views for those annotations are set up before the View Controller even calls viewDidLoad. 

[self updateMapView]; 

}

2

: - (무효) setMapView

:

하고 그래서 setMapView 함수 내 넣어 스토리 보드의 MapView 대리인이 나를 위해 속임수를 사용했습니다. 콜 아웃 화살표가 작동 중입니다.

0

동일한 문제가 있으며도 설정했습니다.은 viewDidLoad이지만 mapView:viewForAnnotation:은 호출되지 않아 내 leftCalloutAccessoryViewUIImageView이 지정되지 않았습니다. 나는 레이 Wenderlich의 Introduction to MapKit in iOS 6 Tutorial을 검토 되돌아 가서이 발견

먼저 MainStoryboard.storyboard을 선택합니다.그런 다음 지도보기를 클릭하고 대리자 항목의 줄을보기 컨트롤러로 끌어서보기 컨트롤러 (오른쪽 상단에 있음)을지도보기의 위임자로 설정하십시오.

2

저도 같은 문제를 겪고, 난 단지 주석 후 대리자를 넣어 완벽하게 작동!

mapView.delegate = self; 
[self.mapView addAnnotation:ann]; 

TKS, 카우 카

관련 문제