Giter Club home page Giter Club logo

Comments (19)

tmdvs avatar tmdvs commented on May 20, 2024

I've never encountered caching before as this is the first time someone's posted the bug on GitHub. I'll try get this fixed and a patch/reason why it's happening tomorrow.

Thanks for filing the bug report!

from tdbadgedcell.

IamAliSufyan avatar IamAliSufyan commented on May 20, 2024

i am also facing this problem. please help!

from tdbadgedcell.

codingarmadillo avatar codingarmadillo commented on May 20, 2024

I seem to have the same issue. Old badges appear when I reloadrowsatindexpaths on another cell.

from tdbadgedcell.

tmdvs avatar tmdvs commented on May 20, 2024

I can't for the life of me recreate this. Can someone supply an example project replicating the issue?

@Andrewtait this is interesting as cells won't redraw unless told to by the table view.

from tdbadgedcell.

mmarszal avatar mmarszal commented on May 20, 2024

hi tmdvs. I'll try to come up with a demo project. unfortunately I just cant give you my active project code as the badges are updated by messages coming through sockets. I'll reply back once I get a usable demo project that reproduces the error.

from tdbadgedcell.

mmarszal avatar mmarszal commented on May 20, 2024

Okay, I came up with an example that shows this problem.
Here are the instructions on how to see it.

The sample app simply has a timer that loops every 5 seconds. On each loop, one cells badge is updated.
First let the program run until all cells have a badge.
Then click on all the cells within the 5 seconds so that all cells have their badges cleared.
Upon the next timer callback, the next cell badge will be updated, but then you will see the old cells will have cached values. If you push the entire table view up to force a redraw, you can see the proper values (ie no cached values).

My app follows a similar approach to filling the badges in. Upon row selection, the badge string is set to nil, and then once data from a socket comes in, the badge is set to the appropriate number. Hope this helps.

http://faultycode.com/badgecaching/BadgeCaching.zip

from tdbadgedcell.

mitchkramez avatar mitchkramez commented on May 20, 2024

I'm seeing this same issue. I've got some static cells that update badge counts on the fly - unfortunately, the updates only appear when you select the row, instead of updating as they're told.

self.cell1.badgeString = @"2"; //doesn't update the badge until the row is selected. if i run this call on a timer or from some other event, the badge doesn't ever update until you select the row.

from tdbadgedcell.

tmdvs avatar tmdvs commented on May 20, 2024

That problem isn't caching. The badge actually doesn't redraw once the cell is drawn. You could tell the badge to redraw with setNeedsDisplay however I will patch this to be automatic tonight.

Sent from my iPhone

On 22 Mar 2013, at 03:58 PM, Mitch Kramer [email protected] wrote:

I'm seeing this same issue. I've got some static cells that update badge counts on the fly - unfortunately, the updates only appear when you select the row, instead of updating as they're told.

self.cell1.badgeString = @"2"; //doesn't update the badge until the row is selected. if i run this call on a timer or from some other event, the badge doesn't ever update until you select the row.


Reply to this email directly or view it on GitHub.

from tdbadgedcell.

tmdvs avatar tmdvs commented on May 20, 2024

@mmarszal @mitchkramez @Andrewtait @AzkaarAli I'm going to do a fairly extensive rewrite of the class tonight to hopefully solve everyones problems. Its great that many others have contributed fixes but I think the time has come just to tidy the code up a little.

I'll notify you all when I push a fix tonight.

from tdbadgedcell.

mitchkramez avatar mitchkramez commented on May 20, 2024

@tmdvs calling

[self.cell1.badge setNeedsDisplay];
or
[self.cell1 setNeedsDisplay];

doesn't seem to have any effect on the badge appearing. it still doesn't appear until i've selected the row. thanks all the same, this class is very interesting and a learning experience for me. i appreciate the responses, time, and code you've put into this very much.

from tdbadgedcell.

mmarszal avatar mmarszal commented on May 20, 2024

@tmdvs I tried fixing this problem myself in the past as well, however, when it comes to core graphics, layers and animations, I'm not too useful. I only have a basic idea when it comes to layers and such (next thing on my to-learn list). But as @mitchkramez said, we appreciate the effort you've done with this class. I couldn't have my nice UI without it!

from tdbadgedcell.

tmdvs avatar tmdvs commented on May 20, 2024

@mitchkramez I've just pushed to the repo a fix for your issue. Simply changing the badge string should now auto redraw it!

from tdbadgedcell.

tmdvs avatar tmdvs commented on May 20, 2024

@mmarszal @mitchkramez @Andrewtait @AzkaarAli I've now fixed this caching bug! Check out the latest version!

from tdbadgedcell.

mitchkramez avatar mitchkramez commented on May 20, 2024

Awesome - this is working as I'd expect it to now... incredible!

from tdbadgedcell.

codingarmadillo avatar codingarmadillo commented on May 20, 2024

Great work, Tim. I had to do a custom cell as I was under a deadline, but will return to this in my next app. Thanks.

from tdbadgedcell.

mmarszal avatar mmarszal commented on May 20, 2024

works extremely perfectly now! Thanks for your hard work @tmdvs, it's quite appreciated.

from tdbadgedcell.

sberrevoets avatar sberrevoets commented on May 20, 2024

Just wanted to thank you for your efforts @tmdvs, I was experiencing the same problem replacing my outdated files with the latest version fixed the problem. Thanks!

from tdbadgedcell.

starecho avatar starecho commented on May 20, 2024

I still meet the same problem with the newest code.

from tdbadgedcell.

tmdvs avatar tmdvs commented on May 20, 2024

@starecho Can you provide an example where this is happening?

from tdbadgedcell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.