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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:51:38+00:00 2026-05-20T12:51:38+00:00

I have a XIB file in which I have a few UI elements. The

  • 0

I have a XIB file in which I have a few UI elements. The resulting view is controlled by my own class derived from UIViewController. This one works fine, and viewDidLoad is called, when the XIB file gets loaded etc from the main application delegate.

However, in that XIB file I also have (obviously) some sub views. One of them is a UITableView. That one is being controlled by a custom class of mine derived from UITableViewController. I’ve set the delegate, datasource outlets on the one side, the UITableViewController also has got the correct view property set. However, the viewDidLoad of the UITableViewController is NOT called when the surrounding view loads.

I think this because the main UIView / UIViewController pair does not really know about the subview. in the UIViewController viewDidLoad I can call the subview’s viewDidLoad. However I am suspecting that this is not the intended usage. So what should I do instead?

What I was assuming was, that subviews loaded from a xib file all get the viewDidLoad message.

  • 1 1 Answer
  • 3 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-20T12:51:39+00:00Added an answer on May 20, 2026 at 12:51 pm

    You’re correct in that you shouldn’t call the subview’s viewDidLoad: method, as it should always get called when the view is loaded (regardless of how the view is created). From the documentation:

    This method is called regardless of whether the views were stored in a nib file or created programmatically in the loadView method.

    This suggests to me that something (connections?) haven’t been set up correctly in your .xib file, or that the controllers haven’t been properly linked with their views. When you say that the UITableViewController has the correct view set, are you using the “view” property instead of the “tableView” property of the UITableViewController…?

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

Sidebar

Related Questions

I have two xib files and for each it's own class which overrides UIViewController
In my xib file I have some View. And I have PainView class (UIView).
I have a UIViewController I am loading from a xib file and pushing onto
I have a custom view in a .xib file, which I use as the
I have 3 file: MyViewController.h MyViewController.m MyViewController.xib MyViewController.xib have some view which i removed?
I have a table view which loads another xib file and uses the content
I have a XIB file with a UITextView, which I'm associating with a UITextView*
I have created a custom view with a XIB file and are loading the
I have made a UIViewController subclass without a .xib file, thinking I would not
I have a picker View in one xib file, and a map View in

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.