macOS/iOS API解説

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

目次

setDelegate:

指定したオブジェクトをアプリケーションのデリゲートにします
-(void)setDelegate:(id)anObject:

解説

指定したオブジェクト(anObject)をアプリケーションのデリゲートにします。
デリゲートは、全てのメソッドを実装する必要はありません。

返り値

( void )

なし

引数

( id )anObject

オブジェクト

フレームワーク

ApplicationKit

クラス

NSApplication

Instance Methods

使用可能

10.0

参照

- delegate

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{
	
	[NSApp setDelegate:self];
	
}
- (void)applicationDidHide:(NSNotification *)aNotification
{
	[info setStringValue:@"applicationDidHide"];
	NSLog([aNotification description]);
}
@end