macOS/iOS API解説

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

目次

postNotificationName:object:userInfo:

遠隔通知センターにポストします
-(void)postNotificationName:(NSString *)notificationName:
             object:(NSString *)anObject:
             userInfo:(NSDictionary *)userInfo:

解説

遠隔通知センターにポストします。
anObjectとuserInfoはnilかもしれない。

返り値

( void )

なし

引数

( NSString * )notificationName

通知名

( NSString * )anObject

オブジェクト

( NSDictionary * )userInfo

追加情報

クラス

NSDistributedNotificationCenter

Instance Methods

使用可能

10.0

参照

- postNotificationName:object:

例文

	  NSDictionary *userInfo = [NSDictionary dictionaryWithObject:@"the string" forKey:@"key"];				  
	[[NSDistributedNotificationCenter defaultCenter] 
		postNotificationName:@"DOServer_AllNotification"
					  object:@"message"
					  userInfo:userInfo
					  ];