Re: Writing Files
Re: Writing Files
- Subject: Re: Writing Files
- From: Thomas Finley <email@hidden>
- Date: Sun, 29 Jun 2003 22:10:33 -0400
On Sunday, June 29, 2003, at 09:40 PM, Tyson Tate wrote:
My question is, how might I go about letting the user specify the
location and name of that file using the standard MacOS X dialog > boxes?
Check out the documentation for NSOpenPanel in AppKit. There are a
wide range of options, but if you're not picky and you only want one
file, this can be VERY simple.
NSOpenPanel *op = [NSOpenPanel openPanel];
[op setAllowsMultipleSelection:NO];
NSArray *psTypes = [NSArray arrayWithObjects:@"ps", @"PS", nil];
if ([op runModalForTypes:psTypes] == NSOKButton) {
NSString *fileToOpen = [op filename];
}
I think you get the idea. (I didn't try compiling this, so I may have
a typo somewhere.)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.