iphone - Cell Imageview with Gesture - Which image was tapped? -
i have uitableview cells displayed image, labeltext , detailtextlabel. cell.imageview configured uitapgesturerecognizer:
uitapgesturerecognizer *tap = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(infoimagetapped:)]; [tap setnumberoftapsrequired:1]; [cell.imageview setgesturerecognizers:[nsarray arraywithobject:tap]];
the method "infoimagetapped" triggered fine. want know image (to more specific, imagenamed) tapped.
i tried following code:
uiimageview *thetappedimageview = (uiimageview *)tap.view; nslog(@"gesture tag: %@", thetappedimageview.description);
in nslog-window: imagenamed (*.png) displayed don't know how write information nsstring variable.
i need imagenamed (or reference original image in cell) open alertview image.
thanks in advance florian
-(void)infoimagetapped :(uitapgesturerecognizer *)gesture { uiimageview *image = (uiimageview *) gesture.view; nslog(@"gesture tag: %@", image.description); }
hope works :)
Comments
Post a Comment