[Biococoa-dev] opening greyed out files

Koen van der Drift kvddrift at earthlink.net
Fri Dec 23 15:33:16 EST 2005

On Dec 23, 2005, at 3:11 PM, Koen van der Drift wrote:

> Anyway, I'll have a go with it and see if I can make the files  
> appear in the open file dialog.

Doh, it may be much easier (as usual...). I just came across the  
NSOpenPanel method setAllowedFileTypes, which seems to solve the  
problem. This is what I now have in MyDocument:

  - (IBAction)openDocument:(id)sender
	int				result;
	NSOpenPanel	*oPanel = [NSOpenPanel openPanel];
	[oPanel setAllowsMultipleSelection: NO];
	[oPanel setAllowedFileTypes: nil];
	result = [oPanel runModalForDirectory: @"path/to/the/exit/" file:nil];

	if (result == NSOKButton)
	//  etc

And completely unrelated to BioCocoa :)


- Koen.

More information about the Biococoa-dev mailing list