iOS UITableViewCell UIImageView setting on different conditions

Posted by chis54 on Stack Overflow See other posts from Stack Overflow or by chis54
Published on 2012-11-11T04:55:26Z Indexed on 2012/11/11 5:00 UTC
Read the original article Hit count: 163

I have an app that has a UITableView and in my Cells I have UIImageViews and UILabels that change images/textColors for a day theme and a night theme (trying to be automatically set).

My issue is that I set the images and colors when the table is populated with cellForRowAtIndexPath and its during the day "theme", then if I reopen the app hours later in the night "theme" and the app is still in the "background" and not needing to be reloaded (ie viewDidLoad doesn't fire), the day "theme" shows until I scroll the UITableView and then the night "theme" shows when new cells are brought into view by scrolling.

How should I set the objects in my cells when changing around time of the day? I was thinking to use an NSTimer, but I'm not sure how to update the objects in my cells. I was also thinking about using the appropriate methods in the AppDelagate to set things in motion, but is there a way to force reloading the TableView?

Any suggestions?

© Stack Overflow or respective owner

Related posts about ios

Related posts about uitableview