开发者

mapview shows 0,0 location when fetching value from xml with space in address

开发者 https://www.devze.com 2023-01-07 10:01 出处:网络
i\'m quite novice in iphone s/w development i was on an application it requires to start mapview from the location specified in xml file but in xml file \"address\" having some spaces in it like \"330

i'm quite novice in iphone s/w development i was on an application it requires to start mapview from the location specified in xml file but in xml file "address" having some spaces in it like "3300 Providence Dr Ste 6" but mkmapview show the location 0,0 instead to find开发者_如何学编程 in google api. so what i'll do to remove those spaces.

i have used google code : @"http://maps.google.com/maps/geo?q=%@&output=csv",string

thanks in advance

with regards prateek bhanot


You probably want to URL-encode the parameter:

NSString *encodedAddress = [address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *urlLString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", encodedAddress];
0

精彩评论

暂无评论...
验证码 换一张
取 消