Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DennisBlah

macrumors 6502
Original poster
Dec 5, 2013
485
2
The Netherlands
Hi all,

I doubt this is possible, but its quite needed for an project of mine.
I have a dynamic list in a plist, which I'm printing on the screen.

Now, I want to fire an timer, that will loop through the same list, but checking some statements, and it should be changing an image infront of the printed value.

Can I do this programaticly, or should I be redrawing the image, and somehow remove the old one ?

Thanks!
 
Apple has a sample code project that displays time zones in a tableview. The app shows an image of a moon or sun to indicate if the time zone is currently in sunlight or darkness and it updates the rows dynamically as time passes to change the moon/sun image based on the time.

I think this sample is called TableView Fundamentals for iOS.
 
Apple has a sample code project that displays time zones in a tableview. The app shows an image of a moon or sun to indicate if the time zone is currently in sunlight or darkness and it updates the rows dynamically as time passes to change the moon/sun image based on the time.

I think this sample is called TableView Fundamentals for iOS.

Code:
    NSArray *visibleCells = self.tableView.visibleCells;
    for (APLTimeZoneCell *cell in visibleCells) {
        NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
        [self configureCell:cell forIndexPath:indexPath];
        [cell setNeedsDisplay];
    }

That might be helpfull! however I'm not working with a for loop but with a timer, and waiting for an reply of another class. After this reply I go to the next cell :)

Thanks for the tip!
 
To me, it's not that this is a for loop vs. a timer action but what happens in that for-block that is the key to solving your issue.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.