Comments (19)
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.
i am also facing this problem. please help!
from tdbadgedcell.
I seem to have the same issue. Old badges appear when I reloadrowsatindexpaths on another cell.
from tdbadgedcell.
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.
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.
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.
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.
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.
@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.
@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.
@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.
@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.
@mmarszal @mitchkramez @Andrewtait @AzkaarAli I've now fixed this caching bug! Check out the latest version!
from tdbadgedcell.
Awesome - this is working as I'd expect it to now... incredible!
from tdbadgedcell.
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.
works extremely perfectly now! Thanks for your hard work @tmdvs, it's quite appreciated.
from tdbadgedcell.
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.
I still meet the same problem with the newest code.
from tdbadgedcell.
@starecho Can you provide an example where this is happening?
from tdbadgedcell.
Related Issues (20)
- Why is an line here....[has snapshot] HOT 5
- How about dismiss the BadgedCell while the value is 0 or NULL? HOT 2
- iOS 7 Badge Offset Not Working HOT 1
- sizeWithFont: deprecated HOT 1
- set badge String hide all title HOT 2
- badgeTextColor does not work in v3.0.
- 'UITableViewCell' does not have a member named 'badgeString' HOT 2
- Vertical line near badge HOT 1
- podspec needs update? HOT 6
- color of font HOT 1
- TDBadgedCell performance issue HOT 5
- use of undeclared type "TDBadgedCell" HOT 8
- Cartage Compatibility HOT 1
- Text is cut off HOT 1
- Can't compile in Xcode 9.1 (swift 3.2/4) HOT 1
- Dynamic Type Support HOT 3
- Feature Request: Activity Indicator HOT 1
- Swift 4.2 errors HOT 1
- Adopt layout from https://github.com/fulldecent/swift5-module-template
- Cell separator does not appear full width in group style UITableView.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tdbadgedcell.