hi. i am trying to dynamically add a UIbutton as a subview to UIlable. but i am not able to click the button. it seems that the lable doesnt allow the buttonTapped event to occur. can somebody explain what exactly is happening here. and can anybody give me an alternative for this. thnx
A:
hi. funny, i got answer on my own after 5 mins of posting this question. It seems that i had to enable my userInteraction on the lables.
ie -
lbl.userInteractionEnabled=YES;
Jayshree
2010-05-08 08:40:07
May not be the best way to set things up, but it works.
Ben
2010-06-11 22:47:20
A:
Your question (and subsequent answer) don't speak to the wisdom (or lack thereof) of doing what you're attempting. UILabel
objects aren't generally meant to be interactive, and placing a UIButton
as a subview to the label, just because you can do it, doesn't sound at all like it's following the Apple HIG for iPhone.
WineSoaked
2010-05-08 09:00:23