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 8323907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:52:17+00:00 2026-06-08T23:52:17+00:00

Let’s say I just created a Cocoa application. I have three files: AppDelegate.h, AppDelegate.m,

  • 0

Let’s say I just created a Cocoa application. I have three files: AppDelegate.h, AppDelegate.m, and MainMenu.xib.

If I don’t touch anything and run the app, does the compiler actually compile AppDelegate.h and AppDelegate.m even though I haven’t written anything?

How does the compiler know what files to include?

  • 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-06-08T23:52:19+00:00Added an answer on June 8, 2026 at 11:52 pm

    Your question is very general but I’ll sketch a few of the high level details. When you create a new project in Xcode you choose a project template to base it on. In your case it sounds like you used the simple Cocoa Application template. This gives you AppDelegate.h, AppDelegate.h, and MainMenu.xib along with a few other files listed under the “Supporting Files” folder in the Project navigator. We’ll get to some of them later. First note that at the top level of your new project directory is something that looks like a file called something like MyProject.xcodeproj. This is actually directory packaged together to look like a single file and inside of it is a file named project.pbxproj. This file is an XML file that contains all the settings for your build. It comes preconfigured by the project template to build a simple application. The basic build process specified in the default project.pbxproj is:

    • Compile AppDelegate.m and main.m
    • Link the object code together with the dependent frameworks
    • Put the executable along with other resources included in the project such as MainMenu.xib into a special directory structure known as an application bundle
    • The Finder can then launch your newly assembled application bundle.

    If you look at main.m you’ll notice it looks a lot like an old style main.c except it runs NSApplicationMain(). This function ends up creating an instance of the “Principal class” listed in the Info.plist in your project. By default this is NSApplication, which is a standard class provided by Cocoa. The “Main nib file base name” is then loaded, which is MainMenu.xib for your project. A nib file is basically just a bunch of “freeze dried objects” that are instantiated and connections are made between them. One of the objects in the MainMenu.xib file is an instance of AppDelegate, which is how this code gets loaded into memory. In the default template the AppDelegate does nothing and MainMenu.xib contains just a standard application menu bar and a blank window. This is what you will see when you run the application.

    You get all this for free as a starting point before you write one line of code. At this point a Cocoa coder would typically start to fill out the AppDelegate, write new classes, or add new nib files for other parts of the UI.

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

Sidebar

Related Questions

Let's say I don't have photoshop, but I want to make pattern files (.pat)
Let's say I have an facebook application running using the JS SDK. First user
Let's say I have two assemblies: BusinessLogic and Web. BusinessLogic has an application setting
Let's say I'm building a data access layer for an application. Typically I have
Let's say I have a large amount of files, say 20GB worth, all encrypted
Let's say I have 2 windows in my application, and two classes responsible for
Let's say I have a method in java, which looks up a user in
Let me explain best with an example. Say you have node class that can
Let's say I have a table with a Color column. Color can have various
Let's say that I have a SQLite database that I create in a separate

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.