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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:32:45+00:00 2026-05-15T18:32:45+00:00

I have a Nib file containing grouped table view and a cell. The cell

  • 0

I have a Nib file containing grouped table view and a cell. The cell is connected to UITableViewController through outlet. In cellForRowAtIndexPath I just return that cell and I can see a single cell in the table view. But when I change the row count of table to 2 and want to show the same cell, then I can see only one, it appears that the second cell is intended to be there, as the lower corners of the visible cell are not rounded, however, it’s not there.

If I create a second cell object in nib file, second outlet and return it as second row, the it appears fine. My cell has identifier specified in IB.

Does it mean I can’t re-use cell object for more than one row?

  • 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-15T18:32:46+00:00Added an answer on May 15, 2026 at 6:32 pm

    In the same way as you would need one instance of a UIButton for each visible button in your view, you will need one instance of your cell for each visible row.

    The common pattern to manage this, is to ask the tableview for a previously instantiated cell that is no longer needed (dequeueReusableCellWithIdentifier:), and then return that cell. If the table view does not have any reusable cells, you have to instantiate a new one from your nib file.

    There are many examples on this around the web, and you can also find some here at SO, ex in this answer.

    I would recommend that you read through Apples TableView Programming Guide, which also contains a section on loading cells from nibs.

    UPDATE:
    An attempt on explaining the TableView and reuse of cells in a different way.

    Lets say we have a large gallery with
    old paintings. Thousands of paintings.
    The gallery has just one display room,
    though, and it has walls for just ten
    paintings. The gallery manager has to
    switch paintings now and then when the
    visitors get bored and want to see
    some new paintings.

    Every displayed painting needs a
    frame. Without a frame, it can’t be
    put on a wall. Frames are expensive to
    make, and take up a lot of space. The
    frame maker guy want have time nor
    money to build the thousands of frames
    needed.

    He finds out that he want be needing
    frames for all the paintings that is
    not shown at the moment. He would only
    need ten frames for the currently
    displayed paintings. When the gallery
    manager takes down a painting, the
    frame maker stores the frame, and when
    the gallery manager put up a new
    painting and asks the frame maker for
    a frame for it, the frame maker
    returns the frame from the previous
    painting again.

    One day, the
    needed-space-between-paintings-regulations
    gets changed for no good reason. The
    gallery manager is able to put up two
    more pictures in the display room. He
    picks two paintings from the store
    room, and asks the frame maker for
    frames. The frame maker has no spare
    frames, and need to make two new
    frames.

    Now, lets say that the gallery is a TableView, and all the paintings are rows of data. The display room with space for ten visible paintings, is the screen, with space for ten visible rows. Each visible row would need a cell, just like each displayed painting would need a frame.

    In the end, you shouldn’t care that much about saving resources by reusing one cell. That’s TableViews responsibility. It’s an implementation detail of the TableView how many cells is needed and how it is used. The protocol defines how you can ask the TableView for an reusable cell, and the documentations states that you should. That should be enough. Demo projects shows that TableView can manage very large amounts of data. If your projects struggles with performance because of instantiating 10-20 cells from nib, you probably got some problems with your nib file or something. There are some discussions, though, about the performance of loading from nib versus building cells in code. It may be interesting to you.

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

Sidebar

Related Questions

I am using a UITableViewController which uploads a table. I have a Nib File
In my application i have a nib file (view A) containing some textFields. In
I have a method that loads a nib file containing a view: [[NSBundle mainBundle]
I am using a NIB file to layout a custom table view cell. This
I have a root view controller with no nib file, I tried adding this
I have a strange issues. I have a nib file with some view inside
I have a uiwebview in a nib file. Not connected to any outlets. Nowhere
I have UItableViewCell created with a nib file, and have put in my cell
I have a nib file. In this I created a new custom view (of
I have created a view MyView in the nib file MyNib My question is

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.