Hongxu Jin
Hongxu Jin

Reputation: 807

Can't use AFHTTPRequestOperationManager

I got a problem when I'm using AFNetworking. I wrote this in my code:

AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

I do add those files in my project, and I also try pod them into my project like this. But the compiler still told me "use of undeclared identifier 'AFHTTPRequestOperationManager'". Someone can help me?

screenshot:screenshot

Upvotes: 14

Views: 15447

Answers (3)

Hongxu Jin
Hongxu Jin

Reputation: 807

In fact, it's because after AFNetworking 3.x, there is no AFHTTPRequestOperationManager any more. You should use AFHTTPSessionManager instead.

Upvotes: 38

Binoy jose
Binoy jose

Reputation: 471

Please check the profile - AFNetworking version

Change to

pod 'AFNetworking', '~> 2.5.4'

and use

import "AFHTTPRequestOperationManager.h"

Upvotes: 8

Maulik Patel
Maulik Patel

Reputation: 397

In Your View controller .h file add

#import <AFNetworking/AFHTTPRequestOperationManager.h>

And then check it

Upvotes: 0

Related Questions