runModalSession:
モーダルセッションを実行します
-(int)runModalSession:(NSModalSession)session
解説
モーダルセッションを実行します。
【モーダルの状態】
● NSRunStoppedResponse
● NSRunAbortedResponse
● NSRunContinuesResponse モーダルセッションは継続中
返り値
( int )
整数値
引数
( NSModalSession )session
セッション
フレームワーク
ApplicationKit
クラス
NSApplication
Instance Methods
使用可能
10.0
参照
- endModalSession:
- run
例文
#import "Controller.h" @implementation Controller NSModalSession mSession; - (IBAction)startModal:(id)sender { int modalCode; [NSApp stopModal]; mSession = [NSApp beginModalSessionForWindow:panelWin]; //モーダルの状態を監視 do { //例外のハンドリング NS_DURING modalCode = [NSApp runModalSession: mSession]; NS_HANDLER NSLog(@"%s\n", [[localException name] cStringUsingEncoding:NSASCIIStringEncoding]); NS_ENDHANDLER NSLog(@"--- noumal "); } while (modalCode == NSRunContinuesResponse); } - (IBAction)endModal:(id)sender { [NSApp stopModal]; [NSApp endModalSession:mSession]; [panelWin orderOut: self]; } @end