开发者

Cocoa Key event problem

I'm trying to build my first cocoa application. done some iPhon开发者_如何学Ce developing before. I have a hard time understanding how to layout my project.

i making a Pong game and my current design is to allocate an NSWindowController from my appDelegate. I then use custom view to act as paddles and ball. My problem is that i can't get the window controller to capture key events. Am i thinking wrong here? My idea is to have a controller class with all the logic, should i subclass another class for that?


Input events will be delivered to the views in the responder chain, so you should add all of your event-handling code to the custom view you mentioned, rather than the window controller.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜