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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:22:56+00:00 2026-05-30T09:22:56+00:00

During application development I have problems to support the right application architecture. This is

  • 0

During application development I have problems to support the right application architecture. This is true for the application I’m currently developing. In particular, I need to support an architecture like the following.

enter image description here

As you can see, the MainViewController is the main controller for the application and has to manage different controllers within the application lifecycle. In this case MainController is a sort of centralized controller (a subview of its view stays always on front, think to it as a menu view) that manages the different states of the application (e.g. LOGIN_AREA, HOME_AREA, etc.).

In the following I wrote some consideration to achieve the above architecture.

Since MainViewController needs always to display its view’s subview in front of other views (UIviewControllerX‘s views), I set it as the rootViewController.

Since MainViewController has to be accessed by the other controllers (e.g UIViewControllers1), they need to have a (weak) reference it.

MainViewController has a public method to manage the application state. It store the current controller and add to its view the selected controller view as its subview. For example:

- (void)manageController
{
   if(currentState == LOGIN_AREA)
   {
      self.currentController = [[[LoginViewController alloc] init] autorelease];
   }

   // other stuff here...

   [self.view addSubView:self.currentController.view];
} 

The above pattern seems to work but I’m not pretty sure if it could be correct. In addiction, the situation gets complicated if a UIViewController (e.g. UIViewController1) has to be a UINavigationController.

I’ve read the View Controller Programming Guide for iOS. In particular, I found interesting the section Creating Custom Content View Controllers but I havent’ found any example to create a customized one.

So, my question is the following.

Could you give me suggestions to achieve the following architecture? Or could you give me some tips to develop a custom content 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-05-30T09:22:58+00:00Added an answer on May 30, 2026 at 9:22 am

    For those interested in.

    To implement a similar machanism there are two different ways.

    1) Implement a custom content container. It’s a complex task but it’s possible. For more info read writing-high-quality-view-controller

    2) Use the new iOS 5 API. For more info it’s possible to read Implementing a Container View Controller section in UIViewController Class Reference.

    Hope it helps.

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

Sidebar

Related Questions

I'm trying to set java.awt.headless=true during the application startup but it appears like I'm
Currently a team of developers is working on Android application and during the development
We're developing an application that will have a plug-in architecture to allow consumers of
I have been using the Grails database-migration plugin during development of my application, and
I am working on a large (100s of assemblies) asp.net application and during development
I have a fun issue where during application shutdown, try / catch blocks are
I have a control in Silverlight 2 that changes state during the application. When
I’m developing an application server, during which I constantly edit–recompile–rerun the code. Unfortunately, after
Lets say you have an application. This application is to be QA tested and
I have an application which contains TextViews and ImageButtons organized in various layouts. This

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.