【发布时间】:2013-08-09 03:23:08
【问题描述】:
我正在尝试从服务器获取 JSON 文件,然后将其显示在表格中,这可以正常工作,但是,出于某种原因,AFNetworking 即使在应用重新启动后也会缓存 JSON 文件。 如何禁用此功能?
NSURL *url = [NSURL URLWithString:@"http://?json"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id responseObject)
{
self.dataget = [responseObject objectForKey:@"data"];
[self.tableView reloadData];
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id responseObject)
{
[HUD hideUIBlockingIndicator];
}];
[operation start];
json 文件可能没有缓存在服务器端:
Cache-Control: no-cache[CRLF]
【问题讨论】:
标签: ios objective-c afnetworking