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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:16:07+00:00 2026-05-19T00:16:07+00:00

If I create a New Project in xcode, then choose View-based Application, the delegate

  • 0

If I create a New Project in xcode, then choose “View-based Application”, the delegate and view controller class templates are generated automatically. Here’s a snippet from DummyAppDelegate.h

@class dummyViewController;

@interface dummyAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    dummyViewController *viewController;
}

My main question is: where is instance variable viewController instantiated? I can see no code for this in the generated files, so is some connection in InterfaceBuilder instantiating it automatically?

A second, lesser question is why @class is used in the code above rather than a simple

#include "dummyViewController.h"

Any help is much appreciated, many thanks!

  • 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-19T00:16:08+00:00Added an answer on May 19, 2026 at 12:16 am

    The window, the view controller, and also the application delegate are all loaded from MainWindow.xib. Any object you place in a NIB file gets instantiated once that NIB file is loaded. And by specifying MainWindow.nib in the app’s Info.plist, you tell Cocoa (actually, the UIApplication instance) to automatically load that file on app startup.

    The @class ... statement is a so-called forward declaration. It is considered good programming practice because its use can shorten compile times (the fewer header files you need import, the faster the compile step is).

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

Sidebar

Related Questions

Every time I create a new project I copy the last project's ant file
I've just create a new MVC project, and have made no changes at all,
Often times a developer on my team will create a new Visual Studio project
When I start a new ASP.NET project in Visual Studio, I can create an
For a new project that I'm doing in PHP I've created an SQLMethods class
This is happening on Vista. I created a new dialog based MFC project to
I create new ASP.NET web application that use SMTP to send message. The problem
I've created a new C++ project in Visual Studio 2008. No code has been
I'm using acmkdir to initialize a new project and it created a README.in file
Whenever I try to add a new project to my SourceSafe repository it creates

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.