Replacing a calloutaccessoryview in mkannotationview

Posted by Mugunth Kumar on Stack Overflow See other posts from Stack Overflow or by Mugunth Kumar
Published on 2010-04-05T08:00:41Z Indexed on 2010/04/05 8:03 UTC
Read the original article Hit count: 465

Filed under:
|
|
|

In my viewForAnnotation delegate, I create a MKAnnotationView with leftCalloutaccessory as a info button. When the info button is tapped, I want to replace it with a UIActivityIndicator. So in the calloutAccessoryTapped delegate, I wrote view.leftCalloutaccessoryView = [UIActivityIndicator indicatorWithStyle:UIActivityIndicatorWhite];

The callout accessory seems to change, but it seems like the view doesn't get updated immediately.

That's when the callout accessory gets hidden (by tapping another pin) and is re-opened, I see a spinner. But otherwise, I don't.

I tried calling [view setNeedsdisplay] and [view setNeedsLayout] and [view layoutsubviews] as well but in vain.

Any suggestions/pointers?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk