runMode:beforeDate:
ループを実行します
-(BOOL)runMode:(NSString *)mode: beforeDate:(NSDate *)limitDate:
解説
acceptInputForMode:beforeDate:を一度呼び出し、ループを実行します。
指定されたモードの入力ソースの期限が全て切れている場合は、ループを実行せずにNOを返します。それ以外はYESを返します。
返り値
( BOOL )
YES/NO
引数
( NSString * )mode
モード
( NSDate * )limitDate
期限
フレームワーク
Foundation
クラス
NSRunLoop
Instance Methods
使用可能
10.0
参照
- run
- runUntilDate
例文
- (IBAction)myAction:(id)sender { NSDate *theDate; theDate = [NSDate dateWithTimeIntervalSinceNow:10]; //10秒後 NSLog(@"wait 10 seconds"); [[NSRunLoop currentRunLoop] runMode:NSEventTrackingRunLoopMode beforeDate:theDate]; NSLog(@"end"); }