私のクラス XI では、次のような通知を投稿します。
[[NSNotificationCenter defaultCenter] addObserver:viewController
selector:@selector(doThis:)
name:@"myNotification"
object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"myNotification" object:nil];
私のクラス YI では、次のように受け取ります。
- (void) doThis: (NSNotification *) notification {
NSLog(@"It works.");
[uiTextView resignFirstResponder]; }
コンソールには NSLog メッセージが表示されますが、私の UITextView はキーボードを非表示にしません。(たとえば、viewDidLoad では、resignFirstResponder/becomeFirstResponder が機能します。)
私がしなければならない特別なことはありますか?