Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objc: NSRangeException when PUT/POST #233

Open
GoogleCodeExporter opened this issue Oct 14, 2015 · 0 comments
Open

Objc: NSRangeException when PUT/POST #233

GoogleCodeExporter opened this issue Oct 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

When I try to execute a code like that:

{{{
id<OASignatureProviding> signatureProvider = [[OAPlaintextSignatureProvider 
alloc] init];
            OAMutableURLRequest *oauthRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:self.auxApiURL] consumer:self.auxOAuthConsumer token:self.auxOAuthToken realm:nil signatureProvider:signatureProvider];
            [oauthRequest setHTTPMethod:@"PUT"];
            [oauthRequest setHTTPBody:deleteJSON];

            [oauthRequest prepare];
}}}

I get a NSRangeException:
{{{
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** 
-[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(0x13a1012 0x1169e7e 0x1356b44 0x95e7 0x10d9c 0x10096 0x8890 0x117d705 0xf8ce 
0xc6fe59 0xc6df22 0xc6f16a 0xc6dedd 0xc6e055 0xbbb338 0x498da81 0x498cd33 
0x49cae3a 0x13438fd 0x49cb4bc 0x49cb435 0x48b53a0 0x1324f3f 0x132496f 0x1347734 
0x1346f44 0x1346e1b 0x22267e3 0x2226668 0xb165c 0x2ba5 0x2aa5 0x1)
libc++abi.dylib: terminate called throwing an exception
}}}

I see a little patch in the Ubuntu One source code that I think that solves the 
problem:
http://bazaar.launchpad.net/~jose-exposito89/ubuntuone-ios-files/social-networki
ng/view/head:/Dependencies/ShareKit/Classes/ShareKit/Core/Helpers/OAuth/Categori
es/NSMutableURLRequest%2BParameters.m#L36

Original issue reported on code.google.com by [email protected] on 27 Nov 2012 at 6:52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant