Changing AFHTTPRequestOperation @properties to be readonly
Rearranging ivars
This commit is contained in:
parent
72d9a24777
commit
a3970f823d
2 changed files with 14 additions and 9 deletions
|
|
@ -30,25 +30,26 @@ extern NSString * const AFHTTPOperationDidFinishNotification;
|
||||||
|
|
||||||
@interface AFHTTPRequestOperation : NSOperation {
|
@interface AFHTTPRequestOperation : NSOperation {
|
||||||
@private
|
@private
|
||||||
NSURLConnection *_connection;
|
|
||||||
NSSet *_runLoopModes;
|
NSSet *_runLoopModes;
|
||||||
|
|
||||||
|
NSURLConnection *_connection;
|
||||||
NSURLRequest *_request;
|
NSURLRequest *_request;
|
||||||
NSHTTPURLResponse *_response;
|
NSHTTPURLResponse *_response;
|
||||||
|
NSError *_error;
|
||||||
|
|
||||||
NSData *_responseBody;
|
NSData *_responseBody;
|
||||||
|
NSUInteger _totalBytesRead;
|
||||||
NSMutableData *_dataAccumulator;
|
NSMutableData *_dataAccumulator;
|
||||||
NSOutputStream *_outputStream;
|
NSOutputStream *_outputStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, retain) NSURLConnection *connection;
|
|
||||||
@property (nonatomic, retain) NSSet *runLoopModes;
|
@property (nonatomic, retain) NSSet *runLoopModes;
|
||||||
|
|
||||||
@property (nonatomic, retain) NSURLRequest *request;
|
@property (readonly, nonatomic, retain) NSURLRequest *request;
|
||||||
@property (nonatomic, retain) NSHTTPURLResponse *response;
|
@property (readonly, nonatomic, retain) NSHTTPURLResponse *response;
|
||||||
@property (nonatomic, retain) NSError *error;
|
@property (readonly, nonatomic, retain) NSError *error;
|
||||||
|
|
||||||
@property (nonatomic, retain) NSData *responseBody;
|
@property (readonly, nonatomic, retain) NSData *responseBody;
|
||||||
@property (readonly) NSString *responseString;
|
@property (readonly) NSString *responseString;
|
||||||
|
|
||||||
+ (id)operationWithRequest:(NSURLRequest *)urlRequest
|
+ (id)operationWithRequest:(NSURLRequest *)urlRequest
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,13 @@ static inline BOOL AFHTTPOperationStateTransitionIsValid(AFHTTPOperationState fr
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface AFHTTPRequestOperation ()
|
@interface AFHTTPRequestOperation ()
|
||||||
@property (nonatomic, assign) AFHTTPOperationState state;
|
@property (readwrite, nonatomic, assign) AFHTTPOperationState state;
|
||||||
@property (nonatomic, assign, getter = isCancelled) BOOL cancelled;
|
@property (readwrite, nonatomic, assign, getter = isCancelled) BOOL cancelled;
|
||||||
|
@property (readwrite, nonatomic, retain) NSURLConnection *connection;
|
||||||
|
@property (readwrite, nonatomic, retain) NSURLRequest *request;
|
||||||
|
@property (readwrite, nonatomic, retain) NSHTTPURLResponse *response;
|
||||||
|
@property (readwrite, nonatomic, retain) NSError *error;
|
||||||
|
@property (readwrite, nonatomic, retain) NSData *responseBody;
|
||||||
@property (readwrite, nonatomic, assign) NSUInteger totalBytesRead;
|
@property (readwrite, nonatomic, assign) NSUInteger totalBytesRead;
|
||||||
@property (readwrite, nonatomic, retain) NSMutableData *dataAccumulator;
|
@property (readwrite, nonatomic, retain) NSMutableData *dataAccumulator;
|
||||||
@property (readwrite, nonatomic, retain) NSOutputStream *outputStream;
|
@property (readwrite, nonatomic, retain) NSOutputStream *outputStream;
|
||||||
|
|
@ -200,7 +205,6 @@ static NSThread *_networkRequestThread = nil;
|
||||||
self.downloadProgress = block;
|
self.downloadProgress = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)setState:(AFHTTPOperationState)state {
|
- (void)setState:(AFHTTPOperationState)state {
|
||||||
if (self.state == state) {
|
if (self.state == state) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue