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

  • Home
  • SEARCH
  • 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 242593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:51:02+00:00 2026-05-11T20:51:02+00:00

I’ve got the code below in my RootViewController (which is a UITableViewController). This code

  • 0

I’ve got the code below in my RootViewController (which is a UITableViewController). This code is executed when the button in the navigation bar is clicked and then (in the simulator) the next view is shown. However, the subviews (UITextLabels, UIButtons) that are drawn in in the view managed by the TripDetailsController are not displayed. Also, in the navigation bar in the top of the screen, the ‘back’ button to the original view is not shown, but when I click on the left side of the navigation bar it does transition back to the original view.

  • TripDetailsController.view is linked to the TripDetailsView (UIView) in Interface Builder
  • tdController does have a value, so it looks as if it is loaded
  • TripDetailsController is in a separate NIB file
  • Using iPhone SDK 2.2.1 (so not 3.0 yet)

Code:

 TripDetailsController *tdController = [[TripDetailsController alloc]
                  initWithNibName:@"TripDetailsController" bundle:nil];
 [self.navigationController pushViewController:tdController animated:YES];
 [tdController release];

In the TripDetailsController class I added the viewDidLoad method like this:

Code:

- (void)viewDidLoad {
  [super viewDidLoad];
  self.navigationItem.title = @"Reis Details";    

  NSLog(@"Subviews: %@", self.view.subviews);
  UILabel *l = [self.view.subviews objectAtIndex:0];
  NSLog(@"Subview 0 bounds: %@", l.bounds);
}

The log messages below do show that the subviews are there, but also that the bounds are not set:

Code:

6/18/09 Jun 18, 2009   10:06:00 PM ReisAdvies[11226] Subviews: (
    <UILabel: 0x56f250>,
    <UILabel: 0x56f5a0>,
    <UILabel: 0x56f6b0>,
    <UILabel: 0x56f780>
) 
6/18/09 Jun 18, 2009   10:06:00 PM ReisAdvies[11226] Subview 0 bounds: (null) 

In Interface Builder the “Label size” tab does show values for X/Y/W/H. Feels like I have to trigger it to do some layout activities, but call layoutSubviews in the viewDidLoad() does not help.
Any ideas what might be the problem here?

  • 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-11T20:51:02+00:00Added an answer on May 11, 2026 at 8:51 pm

    Found the solution, in Interface Builder:

    1. In the NIB file I did not include a UIWindow, so I added a UIWindow to the NIB file and connected the TripDetailsController.view outlet to the newly added UIWindow.
    2. The File’s Owner view property is connected to the TripDetailsView (UIView)
    3. The File’s Owner class is set to UIViewController

    Now it works as expected.

    Not 100% sure if this is ‘the way’ to do it, but at least it seems to work OK for me.

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

Sidebar

Ask A Question

Stats

  • Questions 157k
  • Answers 157k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I don't know if you're using fgetcsv(), but you can… May 12, 2026 at 11:09 am
  • Editorial Team
    Editorial Team added an answer Different industries will have different standards for this. In finance,… May 12, 2026 at 11:09 am
  • Editorial Team
    Editorial Team added an answer You can rewrite your B class like so: class B… May 12, 2026 at 11:09 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.