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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:30:30+00:00 2026-05-28T08:30:30+00:00

In console applications there generally is a main file where you type up what

  • 0

In console applications there generally is a main file where you type up what you want your program to do. In event-driven GUI programs, you have event handlers for each function (such as in Visual C# Windows Forms).

In Cocoa GUI applications, I don’t see a centralized place where I can make variables and run commands. For example, I can make a new class and define all its member functions and data, but I don’t have a place to actually make a new object of that class. Where do I put my “actual program”? I cannot find a file where all parts of the program are put together, I only seem to be able to define classes. A main file and function exists, but they aren’t supposed to be used — main() just starts up the application.

How does this work? Where do I put my program’s code?

  • 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-28T08:30:30+00:00Added an answer on May 28, 2026 at 8:30 am

    Cocoa is an event driven environment, in many ways like .NET. In the vast majority of cases, the system will call you rather than you calling it. So like in your experience with C#, you’re going to hook into various places and wait until you’re called.

    There are two main places you’re going to put your startup “things.” First is the Storyboard or main nib file (Storyboards are new in iOS 5). Any objects you create in your main nib file (or Storyboard) will be automatically created when the program starts. They can then respond to methods like awakeFromNib and viewDidLoad.

    The other major place to kick things off is in the application delegate. This is not the home for all your program, but it is generally the first piece of “your” code that gets run. In particular, you want to add startup code to applicationDidFinishLaunching:withOptions:.

    Before you go any further, I recommend you spend some time in the iOS Starting Point document. If you want to skip ahead a little, you can go to the iOS App Programming Guide. (I assume you’re asking about iOS because most people do these days. If you want Mac, it is very similar. Start with Your First Mac App.)

    Apple documentations tends to be extremely good once you have a feel for where things are. And Cocoa is incredibly consistent (again, once you have a sense of what it’s going to be consistent with). Make sure to read the documents labeled “Programming Guides” rather than just the Reference docs. And when you read the Reference docs, make sure to read the paragraphs at the top. If you just jump into all the method explanations, you’ll skip most of the useful information.

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

Sidebar

Related Questions

I have a windows form that creates multiple console applications of the same program
In a C# console application, is there a smart way to have console output
If I have a console application, is there any way I can handle the
I have a console application that contains quite a lot of threads. There are
Is there a way to show the console in a Windows application? I want
I'm developing a Silverlight application where I want to simulate a console. There are
I am able to create and run boo console applications in Sharpdevelop. Is there
How are GUIs like this made, but in console applications? There are many examples,
I have two simple console applications to integrate nservicebus. One is a publisher, the
I have two projects in my solution Client Server Both compile to console applications.

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.