Reputation: 7507
I have a class (AppController
) with two outlets and two actions.
The two outlets are picked up by Interface Builder and connected fine.
The two actions, though, are not present in the HUD window appearing when ctrl+clicking the AppController object in Interface Builder, nor do they show up in Library->Classes->AppController->Actions.
AppController.h
#import <Cocoa/Cocoa.h>
@interface AppController : NSObject {
IBOutlet NSWindow *newDownloadSheet;
IBOutlet NSBox *downloadsBox;
NSString *sourceFileURL;
NSString *destinationFileName;
NSMutableArray *downloads;
}
- (IBAction)newDocument; // New Download - to respond to File->New, delegates to showNewDownloadSheet:
- (IBAction)showNewDownloadSheet (id)sender;
@end
In the .m file they are defined (although AFAIK Interface Builder doesn't even look at .m files). Also, my code compiles fine (without warnings) and does 'run', it just can't do anything because I can't connect the IBActions.
Mac OS X 10.6 – yes, I know it's old. My computer is too, so I can't upgrade.
XCode 3.2.6
Interface Builder 3.2.6
I could find two other questions on SO on the same problem, but none of the answers worked for me.
...: (id)sender;
. As you can see, one of my actions has this, one doesn't, yet neither shows up.Upvotes: 1
Views: 350
Reputation: 112857
- (IBAction)showNewDownloadSheet (id)sender;
is incorrect, should be
- (IBAction)showNewDownloadSheet: (id)sender;
Notice the missing ":".
Upvotes: 2