macOS/iOS API解説

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

目次

setSuspended:

保留をセットします
-(void)setSuspended:(BOOL)suspended:

解説

保留をセットします。

返り値

( void )

なし

引数

( BOOL )suspended

YES/NO

クラス

NSDistributedNotificationCenter

Instance Methods

使用可能

10.0

参照

- addObserver:selector:name:object:suspensionBehavior:
- postNotificationName:object:userInfo:deliverImmediately:
- suspended

例文

- (IBAction)suspend:(id)sender
{
	if ([[NSDistributedNotificationCenter defaultCenter] suspended]){
		NSLog(@"suspended");
		[sender setTitle:@"not suspended"];
		[[NSDistributedNotificationCenter defaultCenter] setSuspended:NO];
	}else{
		NSLog(@"not suspended");
		[sender setTitle:@"suspended"];
		[[NSDistributedNotificationCenter defaultCenter] setSuspended:YES];
	}
}