开发者

Cocoa Key event problem

开发者 https://www.devze.com 2022-12-22 17:41 出处:网络
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'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

精彩评论

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

关注公众号