updateTimer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(updateTable:) userInfo:[NSDictionary dictionaryWithObject:indexPath forKey:@"idx"] repeats:YES];
- (void)updateTable:(NSTimer *)timer
{
NSIndexPath *indexPath = [[timer userInfo] objectForKey:@"idx"];
Clock *currentCell = [timerListData objectAtIndex:indexPath.row];
NSLog(@"idx:%d",indexPath.row);
[myTableView reloadData];
}
cancel a timer
[timer invalidate];
timer = nil;
iOS Timer Selector with argument
標籤: iOS張貼者: kenywalker 於 晚上10:56
訂閱:
張貼留言 (Atom)
Diseño e iconos por N.Design Studio | A Blogger por Blog and Web

0 意見:
張貼留言