iphone - Get text of label after Touch it [tableView] -
i customized tableview cell set label of time & need if touch/click label show text of label.
here time label set:
cell.time.text = @"5 mins ago"; cell.time.tag = 1; uitapgesturerecognizer* tap = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(tapaction:)]; [cell.time setuserinteractionenabled:yes]; [cell.time addgesturerecognizer:tap];
so when tapped label must below
-(void)tapaction:(id)sender { // want text of label above example must return // 5 mins ago }
thanks in advance..
you can access tap view
-(void)tapaction:(id)sender { uitapgesturerecognizer *taprec = (uitapgesturerecognizer *)sender; uilabel *label = (uilabel *)taprec.view; nslog(@"%@",label.text); }
Comments
Post a Comment