I'm working on my first iPhone application, and I'm getting some very strange behavior when I try to implement tou开发者_如何学JAVAch events.
I set up touchesBegan:withEvent:
and its sister methods under a subclass of UIViewController
, but they aren't registering. What's even weirder is that when I try using touches on the simulator while running the console, the console logs my touches, even though I have no NSLog
statements in my program at all! At one point, I set up NSLog statements under touchesBegan:withEvent:
etc., but I deleted them soon after. I have no idea where these logs are coming from.
Is this some issue with the responder chain? Why is the console behaving so weirdly? Any ideas?
Not weird at all. View controllers are just controllers - not views. You need to implement them in your UIView
subclasses.
As for the strange console output - maybe a clean rebuilt will help, or we need some code to look at.
精彩评论