I'm diving into iOS development and I have a custom URL scheme for my iPhone app that looks like myApp://?q=200
. I have the following code to get the query parameter...
NSString *urlString = [url absoluteString];
NSString *query = [urlString stringByReplacingOccurrencesOfString:@"myApp://?q=" withString:@""];
...but I'd like to make it a bit more future-proof in the event that I add more parameters. How can I extract the "q" parameter in a safer way?
Thanks in advance for your wisdom!