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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:40:58+00:00 2026-06-12T19:40:58+00:00

When the cell becomes visible for the first time the init method will be

  • 0

When the cell becomes visible for the first time the init method will be used.
When the cell becomes visible not for the first time it will be dequeued from the memory of the table view.

UITableViewCell *cell = [searchTable dequeueReusableCellWithIdentifier:identifier];
if (cell == nil)
{
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
}
return cell;

Lets say I’ve scrolled the whole table and now any cell can be dequeued because they all have already been initialized.

My current cells have identifiers from 0 to 199. I refresh my table view and now I have new information for cells. I use method reloadData and use identifiers from 200 to 399 for new cells by adding +200 to cells identifier:

NSInteger index = indexPath.row + 200;
NSString *CellIdentifier = [NSString stringWithFormat:@"%d",index];

Now I scroll the whole table and see cells from 200 to 399.

Lets imagine I change index back to:

NSInteger index = indexPath.row;

Now a question: Old cells with identifiers from 0 to 199 can still be dequeued, can’t they?

If the answer is They CAN be dequeued I have another question:

Is there a way to remove cells with identifiers from 0 to 199 from table view memory when I start to use cells with identifiers from 200 to 399?

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

    UITableView dequeueReusableCellWithIdentifier method will handle that for you. It will deque only the visible cells and not all 200 cells if you are using static [iTableView dequeueReusableCellWithIdentifier:cellIdentifier];

    Here is a discussion on this from apple discussion thread. Check that as well.

    Update:
    You need to modify your cell identifier. If you are creating new CellIdentifier for each row, there is no point in using dequeueReusableCellWithIdentifier since the identifier is different each and every time.

    Instead of

    NSString *CellIdentifier = [NSString stringWithFormat:@"%d",index];
    

    It should be,

    static NSString *CellIdentifier = [NSString stringWithString@"cell"];
    

    That means each and every cell will be reused once the same is not visible. It will just pick cells which are not visible and will reuse it for your the next set of cells which are getting displayed. As per your implementation it will create 300 or 400 cells and you cant do much about removing previous ones since you no longer have any reference to the same.

    Your method will look like this,

    static NSString *CellIdentifier = [NSString stringWithString@"cell"];
    UITableViewCell *cell = [searchTable dequeueReusableCellWithIdentifier:Cellidentifier];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:Cellidentifier];
    }
    cell.textLabel.text = @"something";
    //...
    return cell;
    

    Update2: If you are not using ARC, it should be,

    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:Cellidentifier] autorelease]; 
    

    You need to have an autorelease for the same.

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

Sidebar

Related Questions

When a Slickgrid is added to a table-cell styled div , the grid becomes
Cell A1: =HYPERLINK(#Sheet2!a2,link) Sheet->View Code Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) MsgBox (hello) End
I have a table cell (td) that triggers a script when clicked. I have
I am trying to create a 'blank_star icon' in every cell of a table
Using -didSelectRowAtIndexPath on a UITableViewCell, I fire off a UIActionSheet and the cell becomes
I am able to display the cell content in the table and also Wordwrap
I have used Cell.ContentView in my implementation for customizing the cell contents. It works
To add a UILabel to a table cell I use UILabel *timeLabel = [[UILabel
Folks, I need a solution that allows drag-and-drop cell over the table. The cells
Is there any method to tell a UITableView to not release cells when they

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.