views:

67

answers:

1

I've created a subclass of NSScriptCommand with wich I get my URI.
It works well and with [self directParameter] I get the url.

Now I found the great method [self arguments].

if([self isWellFormed] == YES) {
  NSLog(@"is well formed");
  NSDictionary *dic = [self arguments];
  NSLog(@"dic = %@", dic);
}

But dic is empty. =( Also when the URL is something like myAppUri:foo/bar?a=b#haha...

What I've to do for recognizing this damn arguments?

By the way:

MyApp[39851:813] [self commandDescription] = Command: GetURL ('GURL'/'GURL')
    Implementation class: URLHandlerCommand
    Name: , description: 
    Result type:  ('null')
        Description: 
+1  A: 

GetURL only takes one argument, which is its direct parameter. The command takes no keyword arguments, so of course the dictionary is empty.

If you want the URL's query string arguments, then you need to create an NSURL from the URL string, then send the URL the query message, then parse that yourself (probably using NSScanner).

Peter Hosey