how can i refresh Particular UITabeviewCell through NSTimer?
how can i refresh Particular UITabeviewCell through NSTimer? is it possibl开发者_如何学编程e? any help pls?
Well, you could just call the reloadData
method of your UITableView. It will only refresh visible cells. There's also reloadRowsAtIndexPaths:withRowAnimation
in OS 3.0+
The easiest approach if you don't have special needs would be: (assuming myTableView
has a pointer to your UITableView
)
NSTimeInterval someDelay = 5; // seconds
[myTableView performSelector:@selector(reloadData) withObject:nil
afterDelay:someDelay];
If your ViewController could disappear before the performSelector fires, be safe and call:
[NSObject cancelPreviousPerformRequestsWithTarget:myTableView
selector:@selector(reloadData) object:nil];
精彩评论