initWithCoder breaking my touch events (touchBegan, touchMoved, etc)

Posted by Adam on Stack Overflow See other posts from Stack Overflow or by Adam
Published on 2010-05-19T17:13:41Z Indexed on 2010/05/19 17:20 UTC
Read the original article Hit count: 198

So I have a UIView that has been setup, and in each touch event handler I have an NSLog fire off a message to the console.

- (void) touchesBegan:(NSSSet*)touches withEvent:(UIEvent*)event {
    NSLog(@"touchesBegan");
}

And that pretty much works as expected. But once I implement initWithCoder (even blank)

- (id)initWithCoder:(NSCoder*)coder {
   return self;
}

I no longer receive the message to my console (or can hit breakpoints obviously).

This is my first app so I'm probably missing something dumb, but I've looked through various example apps and I don't appear to be missing any code that would re-enable touch events.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c