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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:23:31+00:00 2026-05-23T20:23:31+00:00

I am writing a Cocoa application that I keep adding buttons, views, and layers

  • 0

I am writing a Cocoa application that I keep adding buttons, views, and layers to. However, because of all these additions my appdelegate class has become rather big and difficult to read. I therefore decided to move some of the UI related calls to other classes from the appdelegate. However, it seems UI calls have to be done only on the main thread, and (correct me if I am wrong) from the appdelegate. My experiment to move calls into other classes also made me run into difficulties on making sure everything was performed correctly on the main thread. So, all of my UI calls are still called from the appdelegate class.

My questions is how can I improve the design of my application? Can I call the UI from other classes than the appdelegate in a way that avoids problems with threading? Can I split the appdelegate class into severeal files, one for buttons, one for views etc., or is there a better way to design the application? Any suggestions on links to examples or tutorials/books are greatly appreciated.

Thanks everyone. Cheers, Trond

  • 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-23T20:23:33+00:00Added an answer on May 23, 2026 at 8:23 pm

    Cocoa is based heavily on the Model-View-Controller architecture. There is some really great reading on how to use this pattern in Cocoa in the Cocoa Design Patterns reference. Basically, you want to have as little UI code in the app delegate as possible. The app delegate should be responsible only for app-level control, if possible. It’s much better to put UI controller code in separate controller classes. The MVC architecture leads you down the right path; Cocoa provides the views, you write your model classes—the “business” logic of your app—and then use a view controller to coordinate the two.

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

Sidebar

Related Questions

I'm writing a Cocoa application that installs itself as an menulet in the menu
I am writing a Cocoa application that makes use of the ParseKit framework (
So, I'm writing a Cocoa application that needs to be able to display web
I am writing a Mac Cocoa application that will manipulate database files, which can
The Problem I'm writing a Cocoa application and I want to raise exceptions that
I'm writing a Cocoa application that displays the contents of an archive file in
I'm writing a Cocoa application that displays the contents of an archive file in
Writing an application in Cocoa that will take input from the user, format it
I am writing an application for OS X (Obj-C/Cocoa) that runs a simulation and
In a cocoa application that I'm writing, I want to create several different kinds

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.