• 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: using NSSavePanel for directories (not files)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using NSSavePanel for directories (not files)


  • Subject: Re: using NSSavePanel for directories (not files)
  • From: <email@hidden>
  • Date: Thu, 5 May 2005 17:52:38 -0400 (EDT)
  • Importance: Normal

Are you already going to know the file name? If you are use an open panel.
If not Well if it were me I would tweak the code to have the user create
the filename for the document when they started a new one. That way you use
an open panel and [openPanel setCanChooseFiles:NO]; (Thats from memory, it
may not be the exact call but you get the idea.)
Otherwise, from a save panel you can gleen the path to the folder they want
to save into with something like:
NSString* path = [[savePanel filename] stringByDeletingLastPathComponent];
or if you are in the writeToFile:(NSString*)path ofType:(NSString*)type
you could do NSString* folder = [path stringByDeletingLastPathComponent];

Hope this helps
Mark.

> My application has an "export" function that can produce a
> representation of the current NSDocument in non-native, read-only
> format.  One of the formats in question needs data written out in
> *two* files.  So, I'd like the user to be able to choose (or create and
> choose) a directory in NSSavePanel.  I will then create the two files
> in that directory using canonical filenames.
>
> Can NSSavePanel be made to work in this way?  What type extension
> would I use to make it only accept directories?
>
> Note that my export format is not a bundle -- users will need to
> access the two files in the directory independently after export.
>
> Thanks,
> Eric
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >using NSSavePanel for directories (not files) (From: Eric Friedman <email@hidden>)

  • Prev by Date: NSOutlineView problem
  • Next by Date: Re: 10.3.9 build errors "Carbon headers missing" ??
  • Previous by thread: using NSSavePanel for directories (not files)
  • Next by thread: NSOutlineView problem
  • Index(es):
    • Date
    • Thread