Re: Saving an NSTextView, and Nib troubles
Re: Saving an NSTextView, and Nib troubles
- Subject: Re: Saving an NSTextView, and Nib troubles
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 31 May 2001 19:53:17 +0200
On jeudi, mai 31, 2001, at 03:33 PM, email@hidden wrote:
Hey, [...] to me ;-)
Why not just have a MainController with an openFile and saveFile action
The openFile method can be:
- (void) openFile:(id) sender
{
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
int result;
[oPanel setAllowsMultipleSelection:NO];
[oPanel setCanChooseDirectories:NO];
[oPanel setCanChooseFiles:YES];
result = [oPanel runModalForDirectory:directoryLocation_ file:nil
types:nil];
if (result == NSOKButton)
{
NSArray *filesToOpen = [oPanel filenames];
myFile_=[[filesToOpen objectAtIndex:0] retain];
// Process here if you want
}
}