Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the app delegate do in a xcode project?

Ok, so when I create a new cocoa project, there's always 2 files that's created for me. That's the .h and the .m NAME AppDelegate file. I've read a lot of books about cocoa and the documentary from apple that told me to create new files instead of using it. What's the point of those 2 files anyways? And is it safe to delete them?

like image 833
TheAmateurProgrammer Avatar asked Nov 08 '10 08:11

TheAmateurProgrammer


1 Answers

Do not delete the App Delegate! This deals with the main "delegate" notifications for the application like:

  • When the application finished loading an is ready for you to add your first controller:

    -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;

  • When the application terminates:

    -(void)applicationWillTerminate:(UIApplication *)application;

Check out this post for more information on the app delegate.

The application delegate is one of the most important files in your project!

like image 95
jodm Avatar answered Oct 02 '22 16:10

jodm