How to check if a view is valid iphone
<p>I am having trouble with my UITableView in the NavigationController.
When I add data to the table I use another class to download images to display in that table, while all that works great but if in the middle of images being download I swtich back to the previous view in the navigationcontroller app crashed.</p>

<p>Here is my code to explain further</p>

<pre><code>- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    // Set appIcon and clear temporary data/image
    UIImage *image = [[UIImage alloc] initWithData:self.activeDownload];
    UIImage *appIcon;

    if (image.size.width != kAppIconHeight &amp;&amp; image.size.height != kAppIconHeight)
    {
        CGSize itemSize = CGSizeMake(125, 85);
        UIGraphicsBeginImageContext(itemSize);
        CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
        [image drawInRect:imageRect];
        appIcon = UIGraphicsGetImageFromCurrentImageContext();
        ///UIGraphicsEndImageContext();
    }
    else
    {
        appIcon = image;
        //self.appRecord.appIcon = image;
    }

    self.activeDownload = nil;


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

    // call our delegate and tell it that our icon is ready for display
    if(delegate != nil)
    [delegate appImageDidLoad:self.indexPathInTableView imaged:appIcon ];

 [image release];

}
</code></pre>

<p>The appImageDidLoad is a method that exists in my UITableView view.</p>

<p>Is there a way I can check to see if the UITableView is valid in my imagedownload class so I know not to send the image.</p>

<p>Thanks in advance.</p>
