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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:55:08+00:00 2026-05-25T23:55:08+00:00

I was trying to create a custom UITableViewCell in Interface Builder and kept setting

  • 0

I was trying to create a custom UITableViewCell in Interface Builder and kept setting the File’s Owner and Custom Class of the actual UITableViewCell to my new custom UITableViewCell Class. I would hook up the IBOutlets from the File’s Owner and get errors when it came to:

 TVCell *cell = (TVCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {

    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TVCell" owner:nil options:nil];

    for(id currentObject in topLevelObjects)
    {
        if([currentObject isKindOfClass:[TVCell class]])
        {
            cell = (TVCell *)currentObject;
            break;
        }
    }

Finally I realized you have to hook up the IBOutlets from the UITableViewCell Object, and not the File’s Owner. Why is this?

Thanks

  • 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-25T23:55:09+00:00Added an answer on May 25, 2026 at 11:55 pm

    The File’s Owner is a placeholder object for the object that will eventually load the NIB. It’s a way for objects outside the NIB to refer to objects inside the NIB. In your case, you’re trying to create the table view cell from the NIB, so you’ll need some other object to be the owner. The table view cell can’t both be outside and inside the NIB.

    In this line of your code:

    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TVCell" 
                                                             owner:nil
                                                           options:nil];
    

    You get to specify an object for the File’s Owner placeholder in Interface Builder to resolve to. I’m guessing your code is in a class like ‘MyTableViewController’. If it is, you could pass ‘self’ for the owner parameter to -[NSBundle loadNibNamed:owner:]. If you did that, you could have outlets on the MyTableViewController class that would be useful for loading this NIB. Specifically, you could use them to avoid the for loop you have. You’d do that like this:

    • Add a ‘loadedTableViewCell’ outlet to MyTableViewController
    • In the table cell nib, set the file’s owner to MyTableViewController.
    • Make a connection for ‘loadedTableViewCell’ from the file’s owner to the table view cell.

    Then change your code to be similar to this:

    TVCell *cell = (TVCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if (cell == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"TVCell" owner:self options:nil];
        cell = [self loadedTableViewCell];
        [self setLoadedTableViewCell:nil];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a custom JSP tag that would take an array object
I'm trying to create a custom MembershipProvider and I was wondering how I would
I am trying to create custom resolver in my ivysettings.xml file: <ivysettings> <settings defaultResolver=default/>
Trying to create a custom component that gets it's layout from an XML file
I'm trying to create a custom class that is based off of an XML
We are trying to create a custom event handler that would fire on ItemAdded
Im trying to create a custom horizontal accordion style showcase. In terms of actual
I'm trying to create a custom helper like this: # app/controllers/my_controller.rb class MyController <
Im trying to create a custom version of the RequiredAttribute to replace the built
I am trying to create a custom accordion for my page to that display

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.