我有许多网点和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