ios - AFNetworking miss implemetation -


afhttprequestoperationmanager has implementation:

 - (afhttprequestoperation *)httprequestoperationwithrequest:(nsurlrequest *)request                                                 success:(void (^)(afhttprequestoperation *operation, id responseobject))success                                                 failure:(void (^)(afhttprequestoperation         *operation, nserror *error))failure  {      afhttprequestoperation *operation = [[afhttprequestoperation alloc] initwithrequest:request];      operation.responseserializer = self.responseserializer;      operation.shouldusecredentialstorage = self.shouldusecredentialstorage;      operation.credential = self.credential;      operation.securitypolicy = self.securitypolicy;       [operation setcompletionblockwithsuccess:success failure:failure];       return operation;  } 

when use method, success , failure blocks never call. after put line in implementation:

[self.operationqueue addoperation:operation]; 

it works. why afnetworking 2.0 afhttprequestoperationmanager miss line or don't understand method? thanks.

httprequestoperationwithrequest creates operation, not execute it. when add operation operation queue created call:

[self.operationqueue addoperation:operation]; 

you executing operation created. success , failure blocks called.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -