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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:55:01+00:00 2026-05-20T02:55:01+00:00

SomeViewController *someVC = [[SomeViewController alloc] initWithNibName:@SomeViewController bundle:nil]; self.someViewController = someVC; [someVC release]; NSLog(@height before

  • 0
    SomeViewController *someVC = [[SomeViewController alloc] initWithNibName:@"SomeViewController" bundle:nil];
    self.someViewController = someVC;
    [someVC release];


    NSLog(@"height before added as subview: %f", self.someViewController.view.frame.size.height);
    [self.containerView addSubview:self.someViewController.view];
    NSLog(@"height AFTER added as subview: %f", self.someViewController.view.frame.size.height);

    // height before added as subview: 480.000000
    // height AFTER added as subview: 540.000000

What possible explanation is there for this? someViewController’s view does not have any autoresizing properties set, and containerView does not autoresize it’s subviews. What could cause the frame to change by just adding it as a subview?

A further mystery to this is that it only happens when someViewController’s view height is >= 480.

  • 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-20T02:55:01+00:00Added an answer on May 20, 2026 at 2:55 am

    What kind of view controller is SomeViewController ? The one thing I think that may be happening is SomeViewController may contain some extra content such as the top bar of an UINavigationController and that is automatically increasing the size sometimes. But what you are doing is violating the HIG by adding the view of one view controller to another view controller. An UIViewController is designed to be the full view of the screen or belonging to a specialized view controller such as an UITabBarController, UINavigationController, or UISplitViewController. As a result someViewController will not function as expected and not receive calls such as viewDidLoad. So if you are sure that no autoresizing properties are set all I can recommend is using an UIView instead of an UIViewController.

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

Sidebar

Related Questions

{ seViewController *seView = [[[seViewController alloc] initWithNibName:@seViewController bundle:nil] autorelease]; [[self navigationController] pushViewController:seView animated:YES]; [seView
I have a mainViewController. I call [self pushModalViewController:someViewController] which makes someViewController the active view.
I'm just wondering about the following 2 approaches. First: SomeViewController *someViewController = [[SomeViewController alloc]
I'm currently setting up this view to be swapped with another in an iPhone
I am trying to understand the behavior of view controllers when switching from one
I'm trying to save some data to core data from a different view and
I have a table view(HomeViewController) consisting of items as: locations Reporting Setting I am
I have a view controller HomeViewController which shows some grids. Once I go to
I am working on a navigation based application which involves LOGIN view. My approach
How to push a view using a button in a navigation controller? I tried

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.