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.
精彩评论