difference between NSUrlConnection and NSMutableUrlConnection
What is the difference between NSUrlConnection
and 开发者_运维百科NSMutableUrlConnection
?
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.
精彩评论