tags:

views:

81

answers:

1

I'm using MPOAuthConnection for Cocoa oauth. I've updated the latest from SVN, built the project and have been playing the example provided. In the example, the method called has no place to set parameters. The WebService API I'm using requires parameters to obtain the data (of course). I've tried modifying the example code directly to slap in the parameters, just to see it working, but get an error when I do so. What format are the parameters supposed to take? I assume the are NSString objects. Here is the code and the resulting error (strings replaced with generic strings for the example):

NSMutableArray *params = [NSMutableArray arrayWithObject:@"key=value"];
[_oauthAPI performMethod:@"method" atURL:_oauthAPI.baseURL 
           withParameters:params withTarget:self 
           andAction:@selector(performedMethodLoadForURL:withResponseBody:)];

This produces the error:

2009-10-25 10:47:19.651 MPOAuthConnection[18879:a0f] -[MPURLRequestParameter length]: unrecognized selector sent to instance 0x1724a0

After the performMethod call, it goes deep into the bowels of the MPOAuthConnection library. So, it could be an error, but if simple parameter setting is failing, I would assume the error is on my end and I am providing parameters incorrectly.

The performMethod's .h entry is thus:

- (void)performMethod:(NSString *)inMethod atURL:(NSURL *)inURL 
                      withParameters:(NSArray *)inParameters 
                      withTarget:(id)inTarget andAction:(SEL)inAction;

Thank you for any help.

A: 

It is expecting an NSArray of MPURLRequestParameter objects. Found the answer deep in a Unit Test.

MarkPowell