我有許多網點和NSSearchfield的視圖,如果用戶在搜索字段中按下箭頭,我想對網點做一些有趣的事情。我想這樣做,沒有子,因爲我有一些問題,與其他類accesing網點在沒有子類化的情況下管理NSSearchfield上的鍵盤事件
編輯: 我與網點的問題是,我不能將其stringValue的從我的子類改變
if ([event keyCode]==126){
Myclass* c= [[Myclass alloc] init]; // the class that have the outlets
[c searchf];} //function that something interesting with the outlets
我不認爲你可以做到這一點沒有繼承...什麼是更確切地說,你的問題與你的IBOutlet? – jlink 2011-05-30 16:45:19