有一个带有cell的UITableview来显示图片。还有labeltext和一个detailTextLabel。cell.imageview
配置了UITapGestureRecognizer
:
UITapGestureRecognizer *tap = [ [UITapGestureRecognizer alloc] initWithTarget:self action:@selector(infoImageTapped:)];
[tap setNumberOfTapsRequired:1];
[cell.imageView setGestureRecognizers:[NSArray arrayWithObject:tap]];
其中方法"infoImageTapped"触发正常,现在我需要判断哪个图片被点击了。
代码:
UIImageView *theTappedImageView = (UIImageView *)tap.view;
NSLog(@"Gesture Tag: %@", theTappedImageView.description);
在NSLog-Window中,图片名称 (*.png) 显示成功了,但是我不知道如何将这个信息写入NSString变量中。
我需要用这个图片名称打开图片的AlertView。