I am parsing a XML-File with NSXMLParser. The number of cells depends on how many entries the XML-File has. This all works fine.
Now I added an UIImageView to my Prototype Cell, in which I'd like to load my URL (declared in the XML-File).
My Storyboard Error: Couldn't compile connection..
I know it's due to the Prototype Cell. But how can I add a UIImageView to all Cells, where different images from XML can be displayed?
EDIT:
Heres my Code, but this is not important.. every time I connect the UIImageView in Interface Builder, the error shows up..
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"productCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
XMLProductView *listedProduct = [appDelegate.products objectAtIndex:indexPath.row];
/*
NSOperationQueue *queue = [NSOperationQueue new];
NSInvocationOperation *operation = [[NSInvocationOperation alloc] init];
[queue addOperation:operation];
*/
NSString *imageURL = listedProduct.image;
NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:imageURL]];
UIImage *image = [UIImage imageWithData:imageData];
[imageView setImage:image];
cell.textLabel.text = listedProduct.name;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}