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

Ides

macrumors member
Original poster
Mar 27, 2012
95
0
I'm working on a simple app right now. I have my main view controller and when the app starts it adds a few custom UIViews to the screen. I need to be able to tell if one of those views is being clicked but for some reason the touchesbegan method isn't being called on those views. Is there something else I need to do in order to have the touchesbegan method called on these views? Also, these views are "on top", so they aren't being covered by anything. I've used touchesbegan many times before without problems, this is the first time I've used it with the ios 6 sdk however.
 
Are they enabled and visible? Are the views of your subclass or linked to your subclassed view controller?
 
Do you have a gesture recognizer attached to the parent view? In iOS 6 this will swallow the touch events.
 
Thanks ArtOfWarfare, I had to enable the views. Im not sure why I was forgetting to do that, maybe because I haven't been coding in objective-c very much lately.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.