2

I was on AFnetworging 2.0.6 and I would like to migrate to 3 or 4.0.1.

I have problem with this part of code I know AFHTTPRequestOperation it's not reuse on version 3 or 4. and I have some error here.

Can you help me please.

    - (void)succeedWithOperation:(AFHTTPRequestOperation *)succeedOperation method:(NSString *)method
{
    NSMutableDictionary *data = [NSMutableDictionary dictionary];
    if (succeedOperation.response) {
        data[@"code"] = @([succeedOperation.response statusCode]);
    }
    if (succeedOperation.responseData) {
        data[@"rawResponse"] = [succeedOperation.responseData copy];
    }
    if (succeedOperation.responseString) {
        data[@"stringResponse"] = [succeedOperation.responseString copy];
    }

error like ==> Property 'response' not found on object of type '__strong id'

If I change AFHTTPRequestOperation by AFHTTPSessionManager or NSURLSessionDataTask I have

No visible @interface for 'NSURLResponse' declares the selector 'statusCode' ...

Thank for your help.

0 Answers0