My Application Objective C Reference
Home
Foundation.framework
NSObject
UIKit.framework
NSObject
UIControl
UIViewController
UIView
AVFoundation.framework
NSTimer Class Reference
タイマーを作る
  • + scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:
  • タイマーを作る
    + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)repeats
    新しいタイマーを作って返す。
    例)
    NSTimer * timer; 
     timer = [NSTimer 
      scheduledTimerWithTimeInterval: 2.00f 
       target: self 
        selector:@selector(timerWillActivate:)
         userInfo: nil repeats:YES];
    
    - (void)timerWillActivate:(NSTimer*)timer {
    
               省略 
    };
    
    [timer invalidate];
    
    参考:NSTimer Class Reference
    Site Map Contact Us
    Copyright 2012 iBeginners All rights reserved.