0
votes

I am getting a crash while adding uiimageView in a containerView inside uitableView. I am performing lazy loading, the images loads successfully but when i scroll the table upwards, application crashes, Please guide me what i am doing wrong.

'NSInvalidArgumentException', reason: '-[UIImage superview]: unrecognized selector sent to instance

Thanks

1
You need to post your code especially on how you add the image view into the table view. - Valent Richie
if ([[profileImg_tmpArray objectAtIndex:indexPath.row] objectForKey:@"userImage"] == nil) {//Launch thread to fetch image docImageView.image = [UIImage imageNamed:@"loding.png"]; [self startItemImageDownload:[profileImg_tmpArray objectAtIndex:indexPath.row] forIndex:indexPath.row];} else{docImageView = [[[profileImg_tmpArray objectAtIndex:indexPath.row] objectForKey:@"userImage"] copy]; } } [containerView addSubview:docImageView] Application crashed at here when i scroll tableView up - york
yes, i have solved the issue @verbumdei thanks - york

1 Answers

2
votes

Somewhere you're using UIImage where it should be UIImageView.