I’m fairly new to Objective-C and cocoa programming, so I don’t really understand the concept of App Delegates.
When we create a cocoa application, do we store our code (Methods, actions, outlets) in the App Delegate files or do we create a new file that will act as a controller and code from there. Right now, I put all of my code in those two files, but from what I read, your goal is to try to make your App Delegate files as slim as possible.
My question is: What’s the usage of the app delegate files?
Talking about
applicationDidFinishLaunching::It’s just your application entry point. Normally you only create the window and your first ViewController, or your Tabbar – your main starting interface class – here.
All the other delegate methods of the
NSApplicationDelegatehave other functions of course. Most of them are the point, where you react on the state of the app. Opened / Closed / Backgrounded / Reopened etc.But you should probably have a look at the programming tutorials in the iPhone documentation. There is a lot of information on how to structure your objc projects. E.g. look here: Start Developing iOS Apps Today
Or if your looking for OSX Apps, look here:
1) Your First Mac App
2) Mac App Programming Guide
There is also a bunch of Sample code.