40media Loading Accessory callout view for mkannotationview


Loading Accessory callout view for mkannotationview



I have a map annotation view that contains a rightcallout button which loads an accessory view which is a UIViewController class. I am using resuable annotations, but am wondering how I can pass updated information to my UIViewController class. Let's say I have 2 string values which map to 2 UILabels on my view. How can I update those values after the initial accessory view has already been loaded into memory as a resusable view?

Any help would be appreciated.


Is NSTimer auto retained?

1:

Submit ajax form on keyboard close without a submit button on the iphone?
You'll need to maintain a reference to the UILabels in the object this receive s the update, and then use setTitle: (I think) to update the labels. Why does this create a memory leak (iPhone)?. UICachedDeviceWhiteColor and NSAutoRelease for table cell mem leaks
Can I develop an iPhone app using java?Lock orientation UIWebView on iPhone

2:

How to ALTER sqlite column (iPhone)?
In your annotation subclass you need to override the setTitle method to send the changes to the instance of your UIViewController class this your subclass is holding. How to escape characters in href=mailto (iPhone)Or, you could setup your annotation subclass to receive notifications (from NSNotificationCenter), and upon receiving a notification, update the title and the instance of your UIViewController class.. If you are unfamiliar with NSNotifications, then here is a quick reference. I used these to keep my annotations updated. NSNotification Example.

3:

Try using the MKMapViewDelegate method:.
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control; 
This method is called when a user tapped one of the annotation view’s accessory although tons. Assuming this your MKMapViewDelegate is also the UIViewController this must access your accessory view..


80 out of 100 based on 55 user ratings 470 reviews