macOS/iOS API解説

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

目次

unhide:

隠されたウインドウをスクリーンに戻して、アプリケーションをアクティブにします
-(void)unhide:(id)sender:

解説

隠されたウインドウをスクリーンに戻して、アプリケーションをアクティブにします。

返り値

( void )

なし

引数

( id )sender

送信オブジェクト

フレームワーク

ApplicationKit

クラス

NSApplication

Instance Methods

使用可能

10.0

参照

- activateIgnoringOtherApps:
- hide:

例文

#import "Controller.h"

@implementation Controller
NSTimer *timer=nil;

- (IBAction)pushButton:(id)sender
{
	[[NSApplication sharedApplication] hide:nil];

	NSDate *theDate = [NSDate dateWithTimeIntervalSinceNow:10]; //10秒後にタイマー起動  
	//userInfoに使う辞書を作成
	NSDictionary *userInfoDictionary =[NSDictionary dictionaryWithObjectsAndKeys:
						self,@"key",nil];
	//タイマー作成
	timer = [NSTimer scheduledTimerWithTimeInterval:1.0
							target:		self
							selector:	@selector(timerControl:)
							userInfo:	userInfoDictionary
								repeats:NO];
	//起動時間セット
	[timer setFireDate:theDate];
	[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSModalPanelRunLoopMode];

}

-(void) timerControl:(NSTimer *)aTimer
{
	[NSApp unhide:[[aTimer userInfo] objectForKey:@"key"]];
}

@end