Get objc_exception_throw when setting cookie with ASIHTTPRequest

Posted by TuanCM on Stack Overflow See other posts from Stack Overflow or by TuanCM
Published on 2010-05-14T11:38:36Z Indexed on 2010/05/14 11:44 UTC
Read the original article Hit count: 340

I got objc_exception_throw when trying to set cookies for a ASIHTTPRequest request. I tried both of these but it didn't work out.

ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:url];

NSMutableDictionary *properties = [[NSMutableDictionary alloc] init];

[properties setValue:@".google.com" forKey:@"Domain"];
[properties setValue:@"/" forKey:@"path"];
[properties setValue:@"1600000000" forKey:@"expires"];


NSHTTPCookie *cookie = [[NSHTTPCookie alloc] initWithProperties:properties];
[request setRequestCookies:[NSMutableArray arrayWithObject:cookie]];

or replacing initiating code for cookie with this one

NSHTTPCookie *cookie = [[NSHTTPCookie alloc] init];

When I commented out the following line, everything worked fine.

[request setRequestCookies:[NSMutableArray arrayWithObject:cookie]];

Can you guys tell me what the problem here!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c