• 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: NSOpenPanel & NSFileTypeForHFSTypeCode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenPanel & NSFileTypeForHFSTypeCode


  • Subject: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • From: John Stiles <email@hidden>
  • Date: Wed, 10 Oct 2007 13:52:11 -0700

Corbin Dunn wrote:


On Oct 9, 2007, at 12:11 PM, Chris Heimark wrote:

I see in docs for NSOpenPanel and NSSavePanel that it is possible to determine filetypes that will be shown/allowed in NSOpenPanel and NSSavePanel via setFileTypes method.

And furthermore, one can use these two functions to take selectivity down to the HFS+ OSType file level.

    NSString *NSFileTypeForHFSTypeCode(OSType hfsTypeCode);
    OSType NSHFSTypeCodeFromFileType(NSString *fileType);

My question is this: Where are the OSType's defined for files/ filesystems?


You probably don't want to go down this route.

And is it possible to use setFileTypes to only allow the selection of a volume?


Yes. You will want to implement:

- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename;

and return "NO" for non-volumes (you have to determine that by whatever logic you want). This disables everything else.

You also probably want to preseed the directory to root with: setDirectory:@"/Volumes", and/or call beginForDirectory:@"/Volumes" -- unfortunately, /Volumes is slightly different than the 'computer' node.

Will this technique show the boot volume (rooted at /)?

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSOpenPanel & NSFileTypeForHFSTypeCode
      • From: Corbin Dunn <email@hidden>
    • Re: NSOpenPanel & NSFileTypeForHFSTypeCode
      • From: Chris Heimark <email@hidden>
References: 
 >NSOpenPanel & NSFileTypeForHFSTypeCode (From: Chris Heimark <email@hidden>)
 >Re: NSOpenPanel & NSFileTypeForHFSTypeCode (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Next by Date: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Previous by thread: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Next by thread: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Index(es):
    • Date
    • Thread