| Home 目次>ApplicationKit>NSApplication このサイトはこちらに移転しました。 | |
unhide:
隠されたウインドウをスクリーンに戻して、アプリケーションをアクティブにします
-(void) unhide:(id)sender
【返り値】 | |
| void | なし |
| 【パラメータ】 | |
| sender | 送信オブジェクト |
【解説】
隠されたウインドウをスクリーンに戻して、アプリケーションをアクティブにします。
【例文】
#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
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSApplication | 修正日2007.12.26 |