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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:38:38+00:00 2026-05-13T16:38:38+00:00

This post is closely related to my previous post: TDBadgedCell keeps caching the BadgeNumber

  • 0

This post is closely related to my previous post: TDBadgedCell keeps caching the BadgeNumber

The “badge” from TDBadgedCell keeps caching the numbers. A very simple example is shown here:

- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";

    TDBadgedCell *cell = (TDBadgedCell *)[_tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        cell = [[TDBadgedCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
        [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
    }

    [cell setBadgeColor:[UIColor blackColor]];
    [cell setBadgeNumber:[indexPath row]];

    [[cell textLabel] setText:[NSString stringWithFormat:%@"%d", [indexPath row]]];

    return cell;
}

Anyone has any clue why this happens? The textLabel and detailTextLabel don’t cache the data. Any additonal info would be welcome as well, as I seem to have a lot of issues with the caching of graphics in UITableViewCells. Any best practices or other useful information would be most welcome.

  • 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-13T16:38:38+00:00Added an answer on May 13, 2026 at 4:38 pm

    OK, I figured this one out. Apparently I shouldn’t use the default code to initialize my cell when using the TDBadgedCell. The following code:

    TDBadgedCell *cell = (TDBadgedCell *)[_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if (cell == nil) {
        cell = [[TDBadgedCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
        [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
    }
    

    Needs to be changed into this:

    TDBadgedCell *cell = [[[TDBadgedCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    

    I am wondering if this is clean in terms of memory usage and such, but it’ll do for now at least.

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

Sidebar

Related Questions

This post is very similar to my previous one, but the data structures are
This post is closely related to another one I posted some days ago .
This is closely related to a previous question i asked. I have a many-to-many
This post is related to my Previous Post . There I was creating the
This post if a follow-up question to mt previous post: Android RESTful Web application
I installed Spring Security Plugin( from here ). I followed the blog post very
This post is the continuation of my previous post . Now I have a
This post is a duplicate from superuser.com, but since I had no answers, I
This post is a follow-up of a related question posted here by Ran .
This post extends the error while submitting data in the form django model.py from

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.