Right now my tableview is displaying empty cells.
In the debugger it shows that I am finding each url and placing them in the appropriate cell.
The app is set up right now that when I tap on the cell safari will open to the webpage with the image.
The image is not displaying in the cell though
Here's a bit of my code. I'm betting something else should go here but I'm not sure what:
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease];
}
// Set up the cell
int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
NSDictionary * dictionary = [stories objectAtIndex:storyIndex];
[cell setLogoImage:[dictionary objectForKey:@"summary"]];
return cell;
}
setLogoImage is set in my CustomCell.m file. Here is what I'm doing there:
Code:
-(void)setLogoImage:(NSString*)sender
{
if(sender !=nil)
{
NSString*downloadURL = [[NSString alloc] initWithString:sender];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:downloadURL]];
request.delegate=self;
[request setDownloadCache:[ASIDownloadCache sharedCache]];
[request setCachePolicy:ASIOnlyLoadIfNotCachedCachePolicy];
[request startAsynchronous];
}
}