开发者

Refreshing status logo in UITableViewCell

开发者 https://www.devze.com 2023-03-11 17:47 出处:网络
I am trying to build a simple chat client. What I have is a UITableView with the user names and a small status image on the left in each cell. I am getting the usernames and current status (offline/on

I am trying to build a simple chat client. What I have is a UITableView with the user names and a small status image on the left in each cell. I am getting the usernames and current status (offline/online) from a server. My problem is how do I refresh my status logo? The code is pretty involving but here's the part where i am loading the images.Any help please.开发者_JS百科.

if (indexPath.section == 1)
{   
    if([[userDetails objectAtIndex:2] isEqualToString:@"Logged Off"]) 
    {
        cell.imageView.image = [UIImage imageNamed:@"offline.png"];

    } else {

        cell.imageView.image = [UIImage imageNamed:@"online.png"];
    }
} 

P.S. it seems that there is some confusion regarding the question..I am getting the status logo to diplay just fine at the initial login..my problem is how do i refresh them as they are changed on the server


try using [cell setNeedsLayout];

0

精彩评论

暂无评论...
验证码 换一张
取 消