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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:55:50+00:00 2026-06-05T11:55:50+00:00

I have a high level controller class that is in charge of managing several

  • 0

I have a high level controller class that is in charge of managing several classes and driving a state machine.

Part of the state logic involves the temporary display of a couple of different screens, there is a dedicated view controller for each of these screens and the high level controller creates these other controller classes and presents them as modal view controllers as necessary.

However one of these view controllers is very simple, it has a button and some text which can change as the state progresses. The high level controller is the class that knows what text to display at what stage and also it needs to know when the button has been pressed.

Therefore the view controller would need to present an API which the high level controller can call to set the text, and also the high level controller would need to be a delegate of the view controller so it can be called back when the button is pressed.
This seems unnecessary plumbing which I’d like to remove.

So I could move the outlets and actions in the view controller into the high level controller so this plumbing isn’t needed. But then there’s nothing left in the view controller (its being instantiated from a nib). So I’d like to get rid of it entirely.

Then once its gone I was planning on having this in the high level controller:

UIViewController *vc = [[UIViewController alloc] initWithNibName:@"TheNib" bundle:nil];

or should it be:
UIViewController *vc = [[UIViewController alloc] init];
[[NSBundle mainBundle] loadNibNamed:@"TheNib" owner:vc options:nil];

[[UIApplication sharedApplication].delegate.window.rootViewController presentViewController: self.vc animated: NO completion:nil];

However how should IB be set up in order to achieve this – specifically
a) what should the File’s Owner be set to?
b) what can the view within the IB be set to?

Note that the high level controller is already inheriting from another class and thus I cannot derive it from UIViewController thus it does not have a view property to connect to the view in IB.

Is there a easy way of connecting the xib contents to the UIViewController that is created within the high level view controller?

  • 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-05T11:55:52+00:00Added an answer on June 5, 2026 at 11:55 am

    A view and its controller is an ‘element of modularity’ Thus, if the view has a button then the view’s controller, not the parent, should be the target of the button. The view’s controller, figuring that parents/others will be interested in button events, should define a delegate interface or a notification interface that parents/others can participate in.

    In your case by ‘removing unnecessary plumbing’ you are 1) moving away from the ‘element of modularity’ and 2) creating difficulties that lead you to ask a question about a problem related to removing plumbing.

    It is best just to use the standard patterns.

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

Sidebar

Related Questions

In subsystem design, I sometimes see software designs that have one high-level class that
I have a simple, low-level container class that is used by a more high-level
I have a high-level goal of creating a static utility class that encapsulates the
I don't have much experience in this yet but the high level question that
My understanding is that a compiler converts the high level language into machine code.
First high-level: I have a web page that will be showing correspondance between a
At a high level, I have done several types of progress bar styles, but
I have heard of some compilers that convert code in one high level language
I have an ImagesController that kicks off a non-trivial save operation. Here's the high-level
I have gateway_response object that represents a high level ActiveMerchant gateway response. I'd like

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.