Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6147739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:09:22+00:00 2026-05-23T19:09:22+00:00

i was wondering when we use the init method in a project? i have

  • 0

i was wondering when we use the “init” method in a project? i have seen many projects without it, they used “applicationDidFinishLaunching” to start the application, but not the init method, do you have any idea about that?

Thanks a lot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:09:22+00:00Added an answer on May 23, 2026 at 7:09 pm

    The init method is used to initialize an object after allocating it.
    In case it is not defined, then the base class implementation is called, as with any other method in Objective-C, and if the base class has got no init method, then the base class’ base class’ init will be called, and so on, up to the NSObject‘s init which is for sure provided.

    If you don’t declare an init method, then you will not be able to properly initialize the ivars in your class, if any.

    About applicationDidFinishLaunching, this is a method for a very special class that any Cocoa/iOS application has got, its application delegate. For example:

     @interface myAppDelegate : NSObject <UIApplicationDelegate> {
     ...
     }
    

    (N.B.: UIApplicationDelegate could be as well NSApplicationDelegate)

    As you see, this class derives from NSObject, so, it will be inited by the framework by calling an init method defined in that class (which one specifically depends on the framework). Then, at some point, the framework will call the applicationDidFinishLaunching method and you have a change to initialize all your delegates’ members and do whatever you need to start your app up.

    In this case, the fact that you are not required to do initialization in an init method but in applicationDidFinishLaunching is related to a specific pattern of interaction between your UIApplication (or NSApplication) object and its delegate. This pattern was defined by Apple in this way;

    1. you specify your application delegate class either in your MainWindow.xib or when calling UIApplicationMain in main.c;

    2. the framework is responsible to instantiate those class (in a custom way that programmers do not need to deal with) and call applicationDidFinishLaunching so that you can do whatever you need with it.

    I hope this explanation helps you understanding what is going on with the app delegate and why you do not declare an init method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering if anyone has any favourite SQL references they to use when creating
I am wondering how to use the facebook javascript in an canvas application (which
I was wondering how to use array_push to multidimensional arrays? I have a multidimensional
I'm wondering how to use a VideoDisplay object (defined in MXML) to display video
I was wondering how to use cin so that if the user does not
I am wondering how to use NUnit correctly. First, I created a separate test
I was wondering why we use the terms push and pop for adding/removing items
I'm wondering what strategies people use for reduced sign on with legacy applications and
I'm wondering about the practical use of #undef in C. I'm working through K&R,
I am wondering if it is possible to use Code Access Security, and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.