MKAnnotationView의 disclosureDetailButton을 UIActivityIndicatorView로 바꿀 수 없습니다.MKAnnotationView의 UIActivityIndicatorView로 disclosureDetailButton을 바꾸는 방법
내 코드는 여기 여기
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)aView
calloutAccessoryControlTapped:(UIControl *)control
{
UIActivityIndicatorView * spinner = [[UIActivityIndicatorView alloc]
initWithFrame:CGRectMake(0, 0, 31, 31)];
[spinner startAnimating];
[aView addSubview:spinner];
[self performSegueWithIdentifier:@"photoMap" sender:self];
}
입니다 내가 annoView.rightCalloutAccessoryView에 스피너를 할당하면, 매핑 할 SEGUE을 준비 코드를, 그것은 충돌 할
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"photoMap"])
{
NSLog(@"the value is %i",(int)self.annotationValue);
UIActivityIndicatorView * spinner = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 31, 31)];
[spinner startAnimating];
MKPinAnnotationView * annoView = [self.annotations objectAtIndex:(NSUInteger)self.annotationValue];
annoView.rightCalloutAccessoryView = spinner;//crash here!!!!!
SecViewController *newVC = segue.destinationViewController;
dispatch_queue_t downloadQueue = dispatch_queue_create("photos downloader", NULL);
dispatch_async(downloadQueue, ^{
NSArray *photos = [FlickrFetcher photosInPlace:[self.places objectAtIndex: (NSUInteger)self.annotationValue] maxResults:50];
dispatch_async(dispatch_get_main_queue(), ^{
[newVC setPhotos:photos];
[newVC setAnnotationValue:self.annotationValue];
[newVC setPlaces:self.places];
newVC.delegate = self;
});
});
dispatch_release(downloadQueue);
}
}
* 코드 블록은 4 칸으로 들여 쓰기해야합니다. 백틱은 코드의 * 인라인 * 스 니펫을위한 것입니다. –
나는 더 새롭다, gocha, thx – user1250152