NSTimerã®ã«ãã´ãªãæ±ã£ãããã¸ã§ã¯ãã¯æ²¢å±±ããã¾ããããã®ä¸ã§ããNSTimer-Blocksãã使ããããã¦éå®ãã¦ãã¾ãã
å®éã«ä½¿ãéã«ã¯ãä¸è¨ã®ããã«ä½¿ç¨ãã¾ããä¸è¨ã®ãµã³ãã«ã³ã¼ãã¯UITableViewã®ã»ã«ãã¿ãããã¦ã3ç§å¾ã«timerTicked
ã®blocksãå¦çãã¾ãã
#import "NSTimer+Blocks.h" -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { void (^timerTicked)() = ^{ UIAlertView* alert = nil; alert = [[UIAlertView alloc] initWithTitle:@"ã¿ã¤ãã¼" message:@"æºäº" delegate:nil cancelButtonTitle:@"éãã" otherButtonTitles:nil]; [alert show]; }; [NSTimer scheduledTimerWithTimeInterval:3.f block:timerTicked repeats:NO]; }