- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *__strong)indexPath
{
TestViewController*detail = [self.storyboard instantiateViewControllerWithIdentifier:@"TestView"];
[self.navigationController pushViewController:detail animated: YES];
detail.outputLabel.text =[NSString stringWithFormat:[mutablearray1 objectAtIndex:indexPath.row]];
// detail.outputImage.image =[NSString stringWithFormat:[mutablearray2 objectAtIndex:indexPath.row]];
}
@end
Using above code i displayed text in tableview cell to detail view.
I also want to display image corresponding to each row in detail view. Problem lies in the commented part i know.
What modification is needed?
when uncomment i got the error: Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSConcreteData getCharacters:range:]: unrecognized selector sent to instance
I assume
outputImageis an UIImageView object.I seems you are setting
NSStringobject instead ofUIImageobject. Please check.