1

When I create a cocoa based mac osx application in xcode. I get a default class AppDelegate which is sublcass of NSObject < NSApplicationDelegate >

The application is one main window which has some buttons , tableview etc,

My question is should I make this AppDelegate class to be the controller of my main window ? or should I create a new controller. Under what condition should I choose my delegate to be the controller and when should I not ?

Ahmed
  • 14,503
  • 22
  • 92
  • 150
  • Does this help? http://stackoverflow.com/questions/3683349/nswindowcontroller-clarification-of-understanding – trojanfoe Feb 08 '13 at 14:47

1 Answers1

0

If the application is not some throwaway test application you should create a new controller and put there logic for the view. If the application starts to grow you may need even more controllers and views e.g. Status bar could be separate view with a separate controller.

In the AppDelegate you should put only the things that are specific for the complete application like menu, starting, stopping etc.

Robert Vuković
  • 4,677
  • 6
  • 31
  • 47