delegate
アプリケーションのデリゲートを返します
@property(assign) id< NSApplicationDelegate > delegate
Swift
weak open var delegate: NSApplicationDelegate?
解説
アプリケーションのデリゲートを返します。
フレームワーク
ApplicationKit
クラス
NSApplication
使用可能
10.0
更新時のバージョン
0S X 10.14.5
Swift4.2
参照
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { id aDelegate = [NSApp delegate]; NSLog([aDelegate className]); NSLog([aDelegate description]); } - (void)applicationDidHide:(NSNotification *)aNotification { [info setStringValue:@"applicationDidHide"]; } @end
Swift4.2
//NSApplication delegate func function002() { let anApplication = NSApplication.shared let obj = anApplication.delegate print("Delegate Object: \(String(describing: obj)).") }
Swift
//NSApplication delegate func function002() { let anApplication = NSApplication.sharedApplication() let obj = anApplication.delegate NSLog("Delegate Object: \(obj).") }