NSString *sttr=[[NSString alloc]init ];
NSURL *jsonURL;
NSString *strurl;
sttr =@"|7 Harvard Drive, Plymouth, MA, 02360, |9121 SW 174th St., Miami, FL, 33157, |7 Harvard Drive, Plymouth, MA, 02360, |";
NSLog(@"StringToSend=%@",sttr);
strurl = [[NSString alloc]initWithFormat:@"http://maps.googleapis.com/maps/api/directions/json?origin=%@&destination=%@&waypoints=optimize:true%@&sensor=false&mode=driving",sttr];
But the when i debug then strurl is always nil .
Whats the issue here is due to spaces in the location name .How can i haandle that .
Thanks in advance
You can separate the components of the string to individual strings and then pass it to the necessary url string.
Try this and see if it works