开发者

How to structure the code for a Cocoa Application

开发者 https://www.devze.com 2022-12-22 15:00 出处:网络
I\'m writing a Cocoa application where I have an auto 开发者_JAVA技巧generated app delegate:(MyAppDelegate.h/MyAppDelegate.m)

I'm writing a Cocoa application where I have an auto 开发者_JAVA技巧generated app delegate:(MyAppDelegate.h/MyAppDelegate.m)

So I am not sure of the best way to structure the class files for this Cocoa application. I understand MVC thoroughly (on the iPhone) but I'm having a block as to try organising the source properly in a Cocoa app.

I need to spawn two separate fullscreen OpenGL views. The problem is that I could simply create classes for "OpenGLView" then instantiate and call all this code into the app delegate, but it seems messy and it's aparently not the place to do it. How would I best achieve the code structure?


Instantiate your application delegate in the MainMenu.xib file and hook it up. When I've done Cocoa fullscreen stuff, I've instantiated the views in the -applicationDidFinishLaunching method of the application delegate. It *is* messy, because for fullscreen views it doesn't really make sense to use interface builder. This is the same way that other folks do fullscreen apps in Cocoa.

0

精彩评论

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