开发者

Is there something like parse_url in Objective C?

开发者 https://www.devze.com 2023-02-03 06:00 出处:网络
Is there there somethings like parse_url() equivalent in Objective C? I like the simplicity of this function in PHP and need the same thing in an iPhone app. For example:

Is there there somethings like parse_url() equivalent in Objective C?

I like the simplicity of this function in PHP and need the same thing in an iPhone app. For example: given a url http://www.goog开发者_JAVA技巧le.com/?someting=somthing

I can get a nice data structure with the host, protocol, base url...etc, without having to create parse strings.

Thanks


There’s NSURL. You can create an NSURL from a string and then use methods like baseURL, path, query, etc.

0

精彩评论

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

关注公众号