Setting MKMapViewLocation with Buttons

Discussion in 'iPhone/iPad Programming' started by RobbS, Apr 21, 2011.

  1. macrumors newbie

    Apr 21, 2011
    Pretty new to app development, still in the learning process.

    In my app, I have three buttons for three different location. I want to set each button to take you to a different location, how would I achieve this?

    I read through the documentation here, but still don't have an answer. Can someone help out?
  2. macrumors demi-god

    Jul 7, 2007
    Do you have the basics setup? By that I mean, does your app currently show a specified location? There's a bunch of tutorials on using the MapKit.

    You need to setup a CLLocationCoordinate2D property and set it to the specific location for each button. Then you can create a region that contains this location and pass that to your mapView.

    Look here:

    [mapView setRegion:region animated:TRUE];
    [mapView regionThatFits:region];

Share This Page