Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mrl72

macrumors regular
Original poster
Apr 20, 2008
221
19
I have a weird issue where a button which is added as a subview of a scrollview, is reacting to touch events fine but in my buttonPressed:(id)sender method it's passing the tag of the main UIScrollView. I have a bunch of other buttons created in the exact same way (not in IB) and they work fine. Any ideas?

Cheers.

Edit: Nevermind, the button had a tag of zero changing this fixed the problem.
 
Last edited:

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Edit: Nevermind, the button had a tag of zero changing this fixed the problem.

I'm happy that you found the solution to this. As an aside all controls have a tag of 0 unless you explicitly set them to something else. As such I'd avoid giving a tag of zero any meaning (i.e. if you want to know which control is the scroll view don't set the scroll view to 0).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.