我有以下AFNetworking 2代碼(來自庫),我嘗試遷移到AFNetworking 3,但我無法理解如何執行數據任務而不是NSOperations。任何幫助,將不勝感激:將代碼從AFNetworking 2遷移到3
NSURLRequest *request = [self requestWithMethod:@"GET"
path:messagePath
parameters:nil];
AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *_operation, id responseObject) {
if (success) {
success(responseObject);
}
}
failure:^(AFHTTPRequestOperation *_operation, NSError *error) {
NSLog(@"%@", error);
if (failure) {
failure(error);
}
}];
你有什麼想說的? –
請點擊此鏈接。 https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide –