我试图将我的应用程序迁移到 iOS 7,因此我必须使用 AFNetworking 2.0。
当我使用此代码时:
NSURL *plistURL = [NSURL URLWithString:@"/test.php"];
NSURLRequest *request = [NSURLRequest requestWithURL:plistURL];
AFHTTPRequestOperation *operation =
[[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.responseSerializer = [AFPropertyListRequestSerializer serializer];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id propertyList) {
//some code
}failure:nil];
[operation start];
}
我收到警告,编译时出现错误:警告:
Incompatible pointer types assigning to 'AFHTTPResponseSerializer<AFURLResponseSerialization> *' from 'AFPropertyListRequestSerializer *'
错误:
AFPropertyListRequestSerializer responseObjectForResponse:data:error:]: unrecognized selector sent to instance 0xdd83160