title: Call Maps for directions from inside your app - iOS5 iOS6
body: <p>Here is a strange problem: My app should be able to call the built in Maps in iOS (both 5.1 and 6). Turns out that it works just fine under iOS6 but not under iOS5.1. The maps in iOS6 is called and the directions from saddr to daddr is traced but when I am in iOS5 the maps app is called but just one pin is put at the daddr. For some unknown reason the initial coordinates (saddr) are not showing and no direction is traced.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>addr = [NSString stringWithFormat: @"maps://saddr=%f,%f&amp;daddr=%f,%f", newLocation.coordinate.latitude, newLocation.coordinate.longitude, oldLatitude, oldLongitude];
  NSURL *url = [NSURL URLWithString:addr];
  [[UIApplication sharedApplication] openURL:url];
  </code></pre>
  
  <p>I have tried change the URL to "http://maps.google.com/something" but it calls Safari instead of built in Maps app. I have noticed that the variables are being passed properly to the URL.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance!</p>