[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSSavePanel
From: |
Ivan Vučica |
Subject: |
Re: NSSavePanel |
Date: |
Wed, 23 Mar 2011 21:22:10 +0100 |
Just wondering: did you consider using NSDocument? Depending on what you're doing it may be more appropriate than NSSavePanel.
Regarding your problem, I have no idea, but the issue might be that you're passing NULL (a.k.a. nil) as the directory. I'd try passing NSHomeDirectory() before anything else.
Also, try checking if [NSApp mainWindow]; works ok. It could maybe still be nil (again, depending on what you're doing).
These are just ideas and starting points of where I'd start my exploration.
On Wed, Mar 23, 2011 at 21:08, Stefan Bidi
<stefanbidi@gmail.com> wrote:
I've never had to use an NSSavePanel before so this is completely new to me. I took a look at the Apple documentation for it and also an example they have. Whenever I run the following code the button gets sunk in and highlighted (and stays that way) but the panel never shows up. Can anyone point me in the correct direction? I have no idea if any of what I have here actually works. In a nutshell, I want to save the data in a NSTableView to a csv file.
- (void) save: (id)sender
{
NSSavePanel *panel = [NSSavePanel savePanel];
[panel setAllowsOtherFileTypes: NO];
[panel setAllowedFileTypes: [NSArray arrayWithObject: @"csv"]];
[panel beginSheetForDirectory: NULL
file: @"output.csv"
modalForWindow: [NSApp mainWindow]
modalDelegate: self
didEndSelector: @selector(savePanelDidEnd:returnCode:info:)
contextInfo: nil];
}
Thanks
_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep
--
Regards,
Ivan Vučica
- NSSavePanel, Stefan Bidi, 2011/03/23
- Re: NSSavePanel,
Ivan Vučica <=