• 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 isn't listening to me? I told it to only allow .zip and .xml!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml!


  • Subject: Re: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml!
  • From: Andy Lee <email@hidden>
  • Date: Fri, 23 Jun 2006 10:19:54 -0400

On Jun 23, 2006, at 8:04 AM, Theodore H. Smith wrote:
if ( [ op respondsToSelector : @selector(setAllowedFileTypes:) ] ) {
// I verified that this branch is being called!
	[op setAllowedFileTypes: aTypes]; // contains @"zip" and @"xml".
	[op setAllowsOtherFileTypes:false];
}

runResult = [op runModalForDirectory:StartPath file: nil ];


I tried your code and it does seem odd that it doesn't do what you'd think it would do. However, this works:

runResult = [op runModalForDirectory:StartPath file: nil type:aTypes];

I notice some odd differences between NSOpenPanel and it superclass NSSavePanel. For one thing, the above method doesn't exist in NSSavePanel, and I don't see why not.

I notice in the NSSavePanel version of -setAllowedFileTypes:, "File type strings encoding HFS file types are not valid values," but HFS file types *are* valid in the NSOpenPanel version, at least according to the docs, which also seems odd -- why have that difference? Or is it a typo in the docs?

The semantics of -setAllowedFileTypes: is presumably different in the two classes. For NSSavePanel it means "only allow the user to *create* files with these extensions." For NSOpenPanel I would have assumed it means "only allow the user to *select* files with these extensions," but apparently that is incorrect.

--Andy

_______________________________________________
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: 
 >NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml! (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: encoding/decoding mutable array
  • Next by Date: Get the application name
  • Previous by thread: Re: NSOpenPanel isn't listening to me? I told it to only allow .zip and .xml!
  • Next by thread: Get the application name
  • Index(es):
    • Date
    • Thread