Does AFNetworking make full block calls on the main thread? Or is it called in the background, do I need to manually send my UI update to the main thread?
Use words instead of codes, the This is rather In AFNetworking 2, a If the sending queue for In AFNetworking 3, the for example code with NSLog
AFJSONRequestOperation * operation = [AFJSONRequestOperation JSONRequestOperationWithRequest: request success: ^ (NSURLRequest * request, NSHTTPURLResponse * response, ID JSON) {self.label.text = JSON [@ "text"]; } Failure: zero]; ?
AFJSONRequestOperation * Operation = [AFJSONRequestOperation should be written like JSONRequestOperationWithRequest: Request Success: ^ (NSURLRequest * request, NSHTTPURLResponse * Feedback ID JSON) {dispatch_async (dispatch_get_main_queue (), ^ {self.label.text = JSON [@ "text"];}); } Failure: zero];
is completionQueue property.
completionBlock of the operation operation is
zero (default), the main queue is used
OS_OBJECT_USE_OBJC @property #if (nonatomic, strong, nULL) completionQueue dispatch_queue_t. #else @property (nonatomic, assign, empty) dispatch_queue_t closing queue; #endif
completionQueue has been moved to the property (which extends
AFHTTPSessionManager ).
To send the dispatch queue if
NULL (default), the main queue is used.
@property (nonatomic, strong) dispatch_queue_t closing queue; @protecti (nonatomic, strong, flexible) after the sender_Q_t;
No comments:
Post a Comment