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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:55:12+00:00 2026-06-06T16:55:12+00:00

I know there are three ways to change the view in iOS 1. [self

  • 0

I know there are three ways to change the view in iOS

1.

[self addChildViewController:thirdViewController]; 
[contentView addSubview:thirdViewController.view]; 

2.

First * sVC = [[First alloc] initWithNibName:@"First" bundle:[NSBundle mainBundle]]; 
[self presentModalViewController:sVC animated:YES];

3.

MyViewController *sampleViewController = [[[MyViewController alloc]initWithXXX] autorelease];       
[self.navigationController pushViewController: sampleViewController animated:true];

pushViewController requires the navigation controller, which I understand. However, when to use addChildViewController and presentModalViewController??

  • 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-06T16:55:14+00:00Added an answer on June 6, 2026 at 4:55 pm

    These are four totally different implementations

    • addChildViewController is used in iOS5 to do viewController containment, this will enable you to easily create your own NavigationCotrollers or TabControllers its only available in iOS5

    • addSubview is the lowest level of the three, this will just add a view to another view, as a child

    • presentModalViewController is used to present a viewController modally on the screen, hence overwriting the old one

    • pushViewController used in UINavigationController to push a new ViewController to the viewcontrollers stack,

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

Sidebar

Related Questions

I know that technically all three ways below are valid, but is there any
I know there are two ways, [self.navigationController pushViewController:siteViewController animated:YES]; [self presentModalViewController:anotherViewController animated:YES]; However, those
First off, I know there are many different easier/reliable ways to perform what I
I know there are ways to get the number of digits after a decimal
I know of three ways to get a full language name of a CultureInfo
Disclaimer: I know there are better ways to track email open rates, which are
I know that there are more practical ways of going about what I'm trying
I know a great thing about perl is that there's multiple ways of doing
I know there are at least three popular methods to call the same function
Does anybody have an idea how to change screens (views) in a MVVM View-First-Approach

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.