I’m looking for a way to split a URL into its component parts so I can handle each element. Why? Because the URL is a custom scheme in an iPhone app that I want to handle specifically.
For example, if a user taps a link with the URL myapp://section/?id=123 I want to use the string after the scheme as the indication of which section to jump to in my app and then split the key/value as an indication of which subview to present to the user.
I’m guessing a Regular Expression would do the trick.
Here’s an example for the NSURL class and its usage.
output: