在我的課XI發佈這樣的通知:只有NSNotification的NSLog工作
[[NSNotificationCenter defaultCenter] addObserver:viewController
selector:@selector(doThis:)
name:@"myNotification"
object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"myNotification" object:nil];
在我的課易接受她這樣的:
- (void) doThis: (NSNotification *) notification {
NSLog(@"It works.");
[uiTextView resignFirstResponder]; }
控制檯顯示的NSLog消息,但我的UITextView確實不隱藏它的鍵盤。 (例如,viewDidLoad中的resignFirstResponder/becomeFirstResponder的作品。)
有什麼特別的事情我需要做嗎?
優秀的評論! – 2012-01-30 23:47:51
哇,謝謝!這對我有很大的幫助。 – derFalke 2012-01-30 23:57:49