I'm trying to get a savePanel working, just.. because. So, I'm using NSSavePanel. I have a simple application, all it has is a so far useless textfield, and a save button. I have outlets that are definitely going to the window (in case I decide to do a sheet) and to the textfield. (for when this is "done") I also have an action coming from the save button. I KNOW my connections are good. Here's my class files:
#import <Cocoa/Cocoa.h>
@interface AppController : NSObject {
NSSavePanel *savePanel;
IBOutlet id savingPanel;
IBOutlet id text;
IBOutlet id myWindow;
}
- (IBAction)savePressed
id)sender;
@end
#import "AppController.h"
@implementation AppController
- (IBAction)savePressed
id)sender {
[savePanel runModalForDirectory
"" file
""];
}
- (void)awakeFromNib {
[savePanel setTitle
"Save game"];
[savePanel setPrompt
"Save"];
[savePanel setCanCreateDirectories:1];
}
@end
I don't get any errors, it runs. But pressing save does NOTHING. Nothing changes. What's wrong?
#import <Cocoa/Cocoa.h>
@interface AppController : NSObject {
NSSavePanel *savePanel;
IBOutlet id savingPanel;
IBOutlet id text;
IBOutlet id myWindow;
}
- (IBAction)savePressed
@end
#import "AppController.h"
@implementation AppController
- (IBAction)savePressed
[savePanel runModalForDirectory
}
- (void)awakeFromNib {
[savePanel setTitle
[savePanel setPrompt
[savePanel setCanCreateDirectories:1];
}
@end
I don't get any errors, it runs. But pressing save does NOTHING. Nothing changes. What's wrong?