views:

633

answers:

1

Here is the question. I am writing app for iPhone OS 3.0, where I want to use Map Kit and Address Book together. I have a database of places( restaurants, for example) with name, location, phone, address and some other data. I list them in table view and when I choose some place I want to show Address Book Contact(with the help of ABUnknownPersonViewController), containing all information, so it is easy for user to add this contact to Address Book.

Now when I click on the address, the app switch me to Maps app. How can I catch this event to show it in my MKMapView (in my app internally)?

One more related question. Is there a way to implement "Direction from here", "Direction to here" buttons in standard Address Book Controller like in Maps app?

A: 

For the related question, direction from here and to here, you can use the URL http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f where you replace the %f's with latitude and longitude of start address (saddr) and destination address (daddr) of your likings. You can fetch the 'here' from the user location's latitude and longitude. This link will open in the default Maps application, but will show directions. HTH

drvdijk
Thank you for your answer, but I am asking about buttons(rows) in standard Address Book Controller(ABUnknownPersonViewController, for example). Like in Maps app(the way it shows an address after clicking accessory view).
azia