Allow UITableViewCell to update content even when scrolling

I have a UITableViewcontaining user UITableViewCellthat contains the time (up to the nearest millisecond). When scrolling, the time text is not updated until the scrolling stops. I know this is probably the desired default behavior for most people, but I want the cell to keep updating even when scrolling. Is there any way to do this? I could not find anything in the documentation.

The cell uses a NSTimerrefresh time function of 30 times per second to recursively call. This function updates the UILabel in the cell.

+4
source share
2 answers

. , . , , . :

downloadAnimationTimer = [NSTimer scheduledTimerWithTimeInterval:.05 target:self selector:@selector(animateDownloadButtons) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:downloadAnimationTimer forMode:NSRunLoopCommonModes];
+4

UITableViewDelegate. View.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    NSArray* arrayVisibleCells = [tableViewContent visibleCells];

    for (UITableViewCell* cell in arrayVisibleCells)
    {
        //update code
    }
}
-2

All Articles