我在按钮点击时将表视图设置为popover。我希望在用户选择任何特定的表视图单元时加载该特定图像。我编写了这样的代码,但它不起作用。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *selectedRow = [clientNameArrays objectAtIndex:indexPath.row];
ClientDetailsView *obj = [[ClientDetailsView alloc]init];
//obj.imageClientImage = clientImageArays;
obj.clientImage.image = (UIImage*)clientImageArays;
}
我该怎么做?
答案 0 :(得分:0)
你根本不是presenting the ViewController
:你即将initialise the ViewController with Image
但是代码如何知道,这应该是应该存在的:
尝试Presenting Or Push Or POPOver OR UIView
来展示它。对于Ex:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *selectedRow = [clientNameArrays objectAtIndex:indexPath.row];
ClientDetailsView *obj = [[ClientDetailsView alloc]init];
//obj.imageClientImage = clientImageArays;
obj.clientImage.image = (UIImage*)clientImageArays;
[self presentViewController:obj animated:YES completion:nil];
}