Tuesday 15 September 2015

iphone - A problem with override UINavigationController -


Now I am working with the cocos2d and I design so that I can add the navigation controller to my cocos 2D application, so I I add the navigation controller to my application. I click on touch it or not near the cocos 2d.

Now I am trying to override the Navigation Controller by adding new new class name and Navigation The heir to the controller

Init I [Super this];

- (BOOL) ccTouchesBegan: (NSSet *) touches with the event: (UIEvent *) Event {NSLog (@ "I Overriding Touch"); Yes come back } - (BOOL) touches with ccTouchesMoved: (NSSet *) Event: (UIEvent *) Event {NSLog (@ "IM Overriding Touch Men"); Yes come back }

this does not call

why you call methods Are ccTouchesBegan: withEvent: and ccTouchesMoved: withEvent: instead of the original name? When you do a UINavigationController subclass, you do not have to change the names of the methods; Instead, you should put the same name and call them on super for example:

  - (zero) touches: (nsset *) of the avant Touches with: (UIIvent *) event {NSLog (@ "I Overriding Touch"); [Super touches brinjal: left with event: incident]; } - Enhanced the touch (zero): (NSSET *) touches the event: (UIEvent *) Event {NSLog (@ "I'm Overriding"); [Super touches: touches with event: incident]; }  

No comments:

Post a Comment