我是AFNetworking的新手,并且运行一个简单的应用程序来了解AFNetworking的工作方式。我正在关注this tutorial on MobileTuts:
我已经包含了AFNetworking库,并且还在每个AFNetworking文件的“编译源”中键入了-fno-objc-arc。
我将这部分包括在实现文件中:
NSURL *url = [[NSURL alloc] initWithString:@"http://itunes.apple.com/search?term=harry&country=us&entity=movie"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"JSON");
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo);
}];
[operation start];
当我点击运行时,我遇到了14个语义问题,项目失败了。
例如,一个错误是:
Method possibly missing a [super dealloc] call.
不知道如何解决此错误。需要一些指导...
最佳答案
尝试这个:
首先delete
AFNetworking
library
并清理项目。
现在download
latest AFNetworking。
再次Add
AFNetworking
library
和build
项目。