Instance Method

removeAnnotation:

Removes the specified annotation object from the map view.

Declaration

- (void)removeAnnotation:(id<MKAnnotation>)annotation;

Parameters

annotation

The annotation object to remove. This object must conform to the MKAnnotation protocol.

Discussion

If the annotation is currently associated with an annotation view, and that view has a reuse identifier, this method removes the annotation view and queues it internally for later reuse. You can retrieve queued annotation views (and associate them with new annotations) using the dequeueReusableAnnotationViewWithIdentifier: method.

Removing an annotation object disassociates it from the map view entirely, preventing it from being displayed on the map. Thus, you would typically call this method only when you want to hide or delete a given annotation.

See Also

Annotating the Map

annotations

The complete list of annotations associated with the receiver.

- addAnnotation:

Adds the specified annotation to the map view.

- addAnnotations:

Adds an array of annotation objects to the map view.

- removeAnnotations:

Removes an array of annotation objects from the map view.

- annotationsInMapRect:

Returns the annotation objects located in the specified map rectangle.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software