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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:16:56+00:00 2026-05-29T06:16:56+00:00

I have a .xib file for my viewController. It contains a TableView and a

  • 0

I have a .xib file for my viewController. It contains a TableView and a UIView. The UIView is backed by a custom class – CommentsBarView (trying to position a small bar with a comments field underneath my tableView).

So in my Document Outline list I have:

  1. view
    • tableView
    • comments bar view
      • UITextView
      • UILabel

Custom class for “comments bar view” is CommentsBarView.

I have outlets connected from within CommentsBarView to the textfield and label.
(and from the ViewController to the tableView).

When I load my with controller with:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

I can access the tableView property and change the appearance of the tableVIew, however, from my commentsBarView initWithCoder I can not set the text value on my textView and label:

- (id) initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {

        [self.commentTextView setText:@"Helo, World!"];  
        [self.characterCountLabel setText:@"200"];
    }

    return self;    
}

It seems as if these properties are not available at initWithCoder time.

If I manually, from my controllers initWithNibName, accesses self.commentsBar.label.text = 200, there is no problem.

Am I experiencing a timing issue where the views are not ready yet or can I not nest a view inside a viewControllers view and have it backed by a custom UIView subclass?

IB is confusing me a bit.

Thanks for any help given.

  • 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-29T06:16:57+00:00Added an answer on May 29, 2026 at 6:16 am

    When loading from a XIB file, the IBOutlets are not ready in the init methods of the objects being unarchived.

    You need to override awakeFromNib in your CommentsBarView to have access to the ready and connected IBOutlets.

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

Sidebar

Related Questions

I have a xib-file with a small UIView on it, which in turn contains
I have a .xib file containing a UIView and 2 UILabel subviews linked to
I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib
I have a View in a xib file and a corresponding ViewController. With Interface
i have built view controller with xib file and navigation bar in it,this view
I have a XIB file with a UITextView, which I'm associating with a UITextView*
I have a UIViewController I am loading from a xib file and pushing onto
If I have something like a UILabel linked to a xib file, do I
I have a tabBarController xib. I've set the first item's class to a view
I am having problem with ViewDidLoad Method.I have one .Xib File in my app

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.