AlexanderDeep
AlexanderDeep

Reputation: 205

difference between NSUrlConnection and NSMutableUrlConnection

What is the difference between NSUrlConnection and NSMutableUrlConnection?

Upvotes: 0

Views: 2109

Answers (1)

Matthew Frederick
Matthew Frederick

Reputation: 22305

As with all Mutable classes, NSMutableURLRequest can be changed.

If you look at the instance methods in the NSURLRequest class reference you see things like initWithURL and initWithURL:cachePolicy:timeoutInterval:. You can initialize them, but there are no methods for changing them.

Compare that to the instance methods in the NSMutableURLRequest class reference: setURL: and setHTTPMethod and such. The mutable version allows you to change things as needed.

Same thing with NSString and NSMutableString, NSArray and NSMutableArray, NSDictionary and NSMutableDictionary: the mutable ones can be changed after initialization.

Upvotes: 7

Related Questions