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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:45:32+00:00 2026-05-16T21:45:32+00:00

I have developed a few applications now all using single view controllers. In each

  • 0

I have developed a few applications now all using single view controllers. In each application in the application delegate I alloc/init the first view controller in “didFinishLaunchingWithOptions” and [window addSubview: view_controller.view].

Now my question is what is best practice for removing and adding secondary views.

At the moment I do the following:

• In my current View Controller on the screen I make a reference to the Application Delegate and call a method say called “showSecondViewController” passing “self”

• Then in the Application Delegate in the “showSecondViewController” method I remove the “self” passed in from the superview and [window addSubview: new_view]; the new view controller.

I would then say several of these remove/show methods to show/hide each view controller needed.

Is this best practice? I was just talking to another iPhone developer about using instead of using this methodology using a Navigation Controller (hiding the top bar) and “animated:NO” pushing and pop’ing the view controllers? Which is best?

The reason also I started thinking about this initial was after watching the Standford University lectures and saw this slide: http://screencast.com/t/N2RkZWIzMzkt which is making me think that what I am doing is not correct.

Please advise.

Thanks
James

  • 1 1 Answer
  • 2 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-16T21:45:33+00:00Added an answer on May 16, 2026 at 9:45 pm

    Seems to me that you’re trying to do by hand what UINavigationController can do for you, so I’d go with that.

    What this slide is telling you is don’t put everything into your app delegate like a big ball of mud. That means, create an object that holds and manages all your views and doesn’t depend on anything else. If it needs access to other objects to work with pass them in using setters or in the -init method, but don’t have it go to the app delegate (or some other central point) and ask for it. That’s called dependency injection.

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

Sidebar

Related Questions

I have developed a few Delphi Win32 (currently using D2007) applications, which revolve around
Right now I have a few new applications being developed against an Oracle Database,
I have developed a website using Razor (Microsoft WebMatrix) and now I want to
In my 4 years of experience,I have developed a lot of web applications. Now,
I have an application that I've developed. Currently it is deployed with all its
a few days ago, I developed a WinForms application in C# using VC#2010 Express.
I currently have a single solution that contains both the one application developed so
I have developed a Java server using Eclipse that accepts TCP socket connection from
i have implemented the in app purchase in my application and added few in
We have a few C++ solutions and we run some build scripts using batch

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.