Iphone – How to open KML file in iphone map applicaion

iphone

I have one kml file in that there are define coordinates for routing.

I want implement below things.When I touch on kml file or kml link then it shoud be open in map applicaion not in browser.

I dont know how to implement that things

Please help me for this query

Edit:

Suppose some buddy has sent me kml file in email or kml file link..When I touch on that file or link then it must be open in iphone map applicaion

Best Solution

There is an example app which you can find in Apple's XCode documentation, it's the KMLViewer.

The App shows how to open KML files. The parsing of the XML is done by hand, there is no library which handles this for you! But the example is very good.

To list your files you'll probably want to use a UITableView. You should read into the documentation first before using it.