i m calling default map app. from my application but for example when i select Portugal language on my iphone for current location NSURL return nil.
I already used UTF8encoding and percentage encapsulate as follows:-
NSString *encodedURLString = [urlString stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
//where urlString has value http://maps.google.com/maps?saddr=Localiza\u00e7\u00e3o+actual&daddr=28.6522907,77.1929857
NSURL *URL = [NSURL URLWithString:encodedURLString];
[[UIApplication sharedApplication] openURL:URL];
i already try NSUTF8Encoding instead NSASCIIStringEncoding but nothing helped.
thanx for any help.
You are percent-encoding the entire URL.
This turns
http://www.google.comintohttp%3A//www.google.com, which is a malformed URL.From the NSURL Class Reference:
Ergo, you are receiving nil.
What you want to do is this: