[英]UITableViewCell detailTextLabel is missing in default implemetation
[英]AFNetworking miss implemetation
AFHTTPRequestOperationManager具有以下实现:
- (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;
}
使用此方法时,成功和失败块永远不会被调用。 我把这一行放在实现中:
[self.operationQueue addOperation:operation];
有用。 为什么AFNetworking 2.0 AFHTTPRequestOperationManager错过了这一行,或者我只是不明白这种方法? 谢谢。
HTTPRequestOperationWithRequest
创建一个操作,但不执行它。 将操作添加到使用此调用创建的操作队列时:
[self.operationQueue addOperation:operation];
您实际上是在执行刚刚创建的操作。 然后将调用成功和失败块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.