2010-01-28 79 views
0

如何知道NSTextField何時重新獲得焦點?NSTextField rec'd重點?

是否有一個委託方法告訴我何時用戶點擊了(或者選擇了)我的NSTextField中的鼠標?

感謝

湯姆

回答

2

子類的NSTextField和覆蓋-becomeFirstResponder

+0

感謝Mike - 我希望/猜測NSTextField可能會在它成爲第一響應者時發出通知。 – TomH 2010-01-28 17:56:46

+0

Mike,'NSTextField'的'-becomeFirstResponder' [自Mac OS X v10.5以後不可用](http://developer.apple.com/library/mac/#documentation/cocoa/reference/ApplicationKit/Classes/ NSTextView_Class/DeprecationAppendix/AppendixADeprecatedAPI.html)。 – dzolanta 2011-04-09 16:06:18

+0

棄用≠「不可用」。此外,'becomeFirstResponder'在'NSResponder'中聲明; *棄用說的是,*調用*這個方法是不行的。子類化它很好。 – 2011-04-09 16:34:28