如何制作包含|的NSURL (管道人物)? [英] How to make an NSURL that contains a | (pipe character)?

查看:102
本文介绍了如何制作包含|的NSURL (管道人物)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图从我的iPhone应用程序访问谷歌地图的前向地理编码服务。
当我尝试从带有管道的字符串中创建NSURL时,我只得到一个nil指针。

I am trying to access google maps' forward geocoding service from my iphone app. When i try to make an NSURL from a string with a pipe in it I just get a nil pointer.

NSURL *searchURL = [NSURL URLWithString:@"http://maps.google.com/maps/api/geocode/json?address=6th+and+pine&bounds=37.331689,-122.030731|37.331689,-122.030731&sensor=false"];

我没有在google api中看到任何其他方式用管道发送边界坐标。
关于我如何做到这一点的任何想法?

I dont see any other way in the google api to send bounds coordinates with out a pipe. Any ideas about how I can do this?

推荐答案

您是否尝试用%7C (char | 的URL编码值)?

Have you tried replacing the pipe with %7C (the URL encoded value for the char |)?

这篇关于如何制作包含|的NSURL (管道人物)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆