【发布时间】:2016-01-28 08:14:23
【问题描述】:
现在我正在使用AFNetworking 2.0,我想将其迁移到AFNetworking 3.0。我已将文件添加到项目中,它显示了许多错误。我检查了migration guide。我的疑问是如何将NSURLCredential 设置为AFNetworking 3.0.4 中的登录请求url。现在我正在使用,
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
if ([url rangeOfString:NSLoginUrl].location != NSNotFound)
{
NSURLCredential *credential = [NSURLCredential credentialWithUser:@"userName" password:@"password" persistence:NSURLCredentialPersistenceNone];
[operation setCredential:credential];
}
但AFNetworking 3 不支持AFHTTPRequestOperation 和
AFHTTPRequestOperationManager。请帮帮我。
【问题讨论】:
标签: ios migration afnetworking nsurlcredential afnetworking-3