1

Possible Duplicate:
Parse NSURL query property

I have a url like this:

someapp://#access_token=1234%D&refresh_token=54%D%D321&instance_url=https%3A%2F%2Fsf.com

I would like to extract those url parameters to get a dictionary like this:

access_token : 1234=

refresh_token : 54==321

instance_url : https://sf.com

How might I be able to do that?

Community
  • 1
  • 1
Andrew
  • 3,901
  • 15
  • 50
  • 64

1 Answers1

1

try:

NSString *url = @"someapp://#access_token=1234%D&refresh_token=54%D%D321&instance_url=https%3A%2F%2Fsf.com";

NSarray *chunks = [url componentSeparatedBy:@"="]; // OR "?/&/etc"
NSLog("%@", chunks);
elp
  • 8,021
  • 7
  • 61
  • 120