TouchesBegan not being called

Discussion in 'iOS Programming' started by Ides, Feb 9, 2013.

  1. Ides macrumors member

    Joined:
    Mar 27, 2012
    #1
    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.
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    Are they enabled and visible? Are the views of your subclass or linked to your subclassed view controller?
     
  3. hollersoft macrumors member

    Joined:
    Feb 10, 2013
    #3
    Do you have a gesture recognizer attached to the parent view? In iOS 6 this will swallow the touch events.
     
  4. Ides thread starter macrumors member

    Joined:
    Mar 27, 2012
    #4
    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.
     

Share This Page