macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

runModalForWindow:

モーダルイベントループを立ち上げます
-(NSInteger)runModalForWindow:(NSWindow *)aWindow

解説

モーダルイベントループを立ち上げます。

返り値

( NSInteger )

整数値

引数

( NSWindow * )aWindow

ウインドウ

フレームワーク

ApplicationKit

クラス

NSApplication

Instance Methods

使用可能

10.0

参照

例文

#import "Controller.h"

@implementation Controller
NSInteger modaiReturnCode;

- (IBAction)pushButton:(id)sender
{
	modaiReturnCode=[[NSApplication sharedApplication] runModalForWindow:panel];	
	NSLog(@"modaiReturnCode %d",modaiReturnCode);
}

- (IBAction)stopButton:(id)sender
{
	[[sender window] orderOut:self];
	[NSApp stopModalWithCode:modaiReturnCode];
}

@end