Iphone 有人注意到网络中断后图像无法加载吗?

Iphone 有人注意到网络中断后图像无法加载吗?,iphone,uitableview,lazy-loading,nsurlconnection,Iphone,Uitableview,Lazy Loading,Nsurlconnection,我刚刚注意到,当网络中断时,苹果提出的代码无法加载图像。。。不过,它在其他方面效果很好;) 这是因为如果NSURL连接失败,IconDownloader不会执行任何操作 在我独自解决这个问题之前,有谁能给我一些建议:D 非常感谢 Gotye.==>我认为如果nsurlconnection方法因连接而失败,我们可以这样下载 - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {

我刚刚注意到,当网络中断时,苹果提出的代码无法加载图像。。。不过,它在其他方面效果很好;)

这是因为如果NSURL连接失败,IconDownloader不会执行任何操作

在我独自解决这个问题之前,有谁能给我一些建议:D

非常感谢


Gotye.

==>我认为如果nsurlconnection方法因连接而失败,我们可以这样下载

  - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error

{
          // Clear the activeDownload property to allow later attempts
            self.activeDownload = nil;

          // Release the connection now that it's finished
       self.imageConnection = nil;


  //i think we can call the connection method again from here

       self.activeDownload = [NSMutableData data];
          // alloc+init and start an NSURLConnection; release on completion/failure
       NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:
                         [NSURLRequest requestWithURL:
                          [NSURL URLWithString:appRecord.imageURLString]] delegate:self];
       self.imageConnection = conn;
       [conn release];



}

==>如果nsurlconnection方法因连接失败,我认为这就是我们可以下载的方法

  - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error

{
          // Clear the activeDownload property to allow later attempts
            self.activeDownload = nil;

          // Release the connection now that it's finished
       self.imageConnection = nil;


  //i think we can call the connection method again from here

       self.activeDownload = [NSMutableData data];
          // alloc+init and start an NSURLConnection; release on completion/failure
       NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:
                         [NSURLRequest requestWithURL:
                          [NSURL URLWithString:appRecord.imageURLString]] delegate:self];
       self.imageConnection = conn;
       [conn release];



}