问题
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
回答1:
In fact, it's because after AFNetworking 3.x, there is no AFHTTPRequestOperationManager any more. You should use AFHTTPSessionManager instead.
回答2:
Please check the profile - AFNetworking version
Change to
pod 'AFNetworking', '~> 2.5.4'
and use
import "AFHTTPRequestOperationManager.h"
回答3:
In Your View controller .h file add
#import <AFNetworking/AFHTTPRequestOperationManager.h>
And then check it
来源:https://stackoverflow.com/questions/33893706/cant-use-afhttprequestoperationmanager