1

AFNetworking を使用して、Web から JSON を取得しています。非同期リクエストから返されたレスポンスを取得するにはどうすればよいですか? これが私のコードです:

- (id) descargarEncuestasParaCliente:(NSString *)id_client{

        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://whatever.com/api/&id_cliente=%@", id_client]]];

        __block id RESPONSE;

        AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {

            RESPONSE = JSON;

        } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
            NSLog(@"ERROR: %@", error);
        }];

        [operation start];

        return RESPONSE;
    }
4

1 に答える 1