You need to #import
the header containing the declaration of HUDPanelDictionary.
For example:
#import "HUDPanelDictionary.h"
@interface MyController
- (IBAction)hideDictionaryPanel:(id)sender {
[HUDPanelDictionary close];
}
@end
I would also name things differently, for example "DictionaryHUD" rather than "HUDPanelDictionary." "Panel" is redundant with "HUD," and you should care more about its intent than its position in the class hierarchy.
Another thing I would do is make DictionaryHUD an NSWindowController subclass, and have it expose a singleton shared instance rather than use a global variable to point to the panel itself. Then the code above would look like this:
#import "DictionaryController.h"
@interface MyController
- (IBAction)hideDictionaryPanel:(id)sender {
[[DictionaryController sharedDictionaryController] hideDictionaryPanel:sender];
}
@end
This puts the primary responsibility for your dictionary panel/HUD on an instance of a single controller class, to which other controllers (say one that manages your main window's toolbar) can forward their interactions. You could even put the dictionary HUD window controller in the responder chain to have it automatically handle actions like -hideDictionaryPanel:
so nothing needs to do that kind of forwarding.