• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Writing Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: Writing Files
      • From: Thomas Finley <email@hidden>
References: 
 >Writing Files (From: Tyson Tate <email@hidden>)

  • Prev by Date: Re: Static libraries
  • Next by Date: Re: Writing Files
  • Previous by thread: Writing Files
  • Next by thread: Re: Writing Files
  • Index(es):
    • Date
    • Thread