我正在尝试从服务器获取数据,以便在需要时在本地存储。数据存在于不同的答案中。我想在一次刷新点击时调用所有这些apis。请帮我解决这个问题。
-(void) call:(NSString *)url{
NSURLRequest *Request1 = [NSURLRequest requestWithURL :[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
// calling only one api
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:Request1 delegate:self startImmediately:YES];
// flag = true;
[SVProgressHUD showWithStatus:@"Wait while we fetch data .."];
if (connection){
NSLog(@"connection success");
}
else{
// handle error here
}
}