3

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.google.com/?someting=somthing

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

Thanks

Jason
  • 31
  • 4

1 Answers1

6

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

zoul
  • 102,279
  • 44
  • 260
  • 354