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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -