NSMutableRequest skd problem

Posted by user2164 on Stack Overflow See other posts from Stack Overflow or by user2164
Published on 2010-06-11T14:14:26Z Indexed on 2010/06/11 15:02 UTC
Read the original article Hit count: 191

Filed under:
|

Hi, I am trying to make a web call with the iPhone. I have done this before and it works fine but now I can't make it work. I am trying to use the following method call which the documentation says is availble in 2.0 and later:

- (void)addValue:(NSString *)value forHTTPHeaderField:(NSString *)field;

I am attempting to build for version 3.2 and 4.0.

NSMutableURLRequest *request = [NSURLRequest 
                                requestWithURL:url 
                                cachePolicy:NSURLRequestReloadIgnoringCacheData 
                                timeoutInterval:30];

[request addValue:@"0" forHTTPHeaderField:@"Content-Length"];

The error that I'm getting is a runtime error that says

"-[NSURLRequest addValue:forHTTPHeaderField:]: unrecognized selector sent to instance 0x600e0c0"

Can anyone tell me what I am missing that stops this code from working?

Thanks.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about nsmutableurlrequest