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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:32:39+00:00 2026-06-11T19:32:39+00:00

I have a little problem and I need to understand how stuff works. I’ve

  • 0

I have a little problem and I need to understand how stuff works. I’ve searched within SO but I didn’t find any valid solution.

My scenario is the following.

I have a UITableViewController that loads cells (within its table using) by means of UINib method instantiateWithOwner:.

- (UITableViewCell *)tableView:(UITableView *)tableView 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CustomTableViewCell *cell = (CustomTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellClassName];
    if (!cell) {

        NSArray *topLevelItems = [cellLoader instantiateWithOwner:self options:nil];
        cell = [topLevelItems objectAtIndex:0];
    }

    // other stuff here...

    return cell;
}

Cells are displayed correctly. Now, I need to customize each cell based on different criteria and I think the correct place to do it is in awakeFromNib method. Fr example, within CustomTableViewCell.m, I override awakeFromNib like the following:

- (void)awakeFromNib
{
    // my internal stuff here
}

But awakeFromNib is not called.

Could you explain what I’m doing wrong?

Thank you in advance.

  • 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-06-11T19:32:40+00:00Added an answer on June 11, 2026 at 7:32 pm

    Actually you need to customize in the code you showed ‘other stuff here’. Since you recycle cells you need to insure the cell is configured correctly at each usage.

    EDIT: I made a test project, and verified awakeFromNib is in fact sent to the class. This leads me to believe the root problem is that in your nib with the cell, you have not set the class of the cell to your CustomClass name. Its the only possible explanation.

    EDIT2: So to reiterate:

    • in CustomTableViewCell.xib, the class of the object is set to ‘CustomTableViewCell’

    • add some log messages in CustomTableViewCell.m – in the initWithCoder: if you have it and also in awakeFromNib (make sure of spelling!!!)

    • when you instantiate here ‘cell = [topLevelItems objectAtIndex:0];’, add a log before NSLog(@”Going to instantiate”), the afterwards a log:

      NSLog(@"Instantiate a %@ cell", NSStringFromClass([cell class]);
      

    Something has to give here. What is your deployment target? In my test I used 5.1

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

Sidebar

Related Questions

i have a little problem, i'm searching, but i can't found what i need,
I have little unusual problem to solve. I need some hint or links to
I have a little problem, I need to make directory from my c code
i have a little problem and see no solution for it. I need flexible
I need a little push in the right direction. Here's my problem: I have
I have a little problem that I don't understand. I have a db that
I have a little problem..but im goin' to crazy... In the html i have
I have a little problem, what I need is to read data from this
I have a little problem, I need to send an ajax request to a
I need to write a graph using C++ and I have a little problem.

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.