0

I have a tableview cell as following:

enter image description here

Now, when I tap on Danile Craig or Michale Kevin (bold parts), I want to perform action and action should be able to log row number from which the text was tapped. How can I do this in Objective-C?

I have used TTTAttributedLabel to do the above formatting. This seems to associate those label actions with the link, but they are not linked in my case.

Neeku
  • 3,646
  • 8
  • 33
  • 43
Lasang
  • 1,369
  • 6
  • 24
  • 44
  • Seems like your ultimate goal is to show a profile info view for these names you tapped on, not just log row numbers. In any case, if you just want to log the row number, why not just use the tableView delegate method didSelectRowAtIndexPath:(NSIndexPath *)indexPath to get the row number using indexPath.row ? – Zhang Jul 04 '14 at 09:35
  • yes, you are right. But, click on Danile Craigh should show profile image of Danile Craig where as clcik on Michale Kevin should show profile of Michal kevin. And besides, only these text should be clickable, not whole row. So, didSelectRowAtIndexPath:(NSIndexPath *)indexPath will not work simply becuase it wil select whole cell. Thanks anyway for effort. :) – Lasang Jul 04 '14 at 09:42
  • I found this, maybe it can help you: http://stackoverflow.com/questions/19332283/detecting-taps-on-attributed-text-in-a-uitextview-on-ios-7 – Zhang Jul 04 '14 at 09:44

0 Answers0