我正在制作一个从 plist 下载数据并在 tableview 中使用该数据的应用程序。有没有办法检查与 url 的连接是否成功,然后下载是否成功?或者也许是一个实现类似这样的教程?
谢谢
你必须实现这个 NSURLConnection 的委托
//send the request
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
NSlog(@"no connection");
}