Re: NSOpenPanel and ".app" fileType and aliases
Re: NSOpenPanel and ".app" fileType and aliases
- Subject: Re: NSOpenPanel and ".app" fileType and aliases
- From: Diggory Laycock <email@hidden>
- Date: Tue, 11 Dec 2001 14:16:59 +0000
I can't find any way round this and I notice that the internet prefpane of
System Preferences has the same problem - so Assuming this is a bug in NSOpenPanel
- should I send info to the OS X feedback page or is there a better route
for cocoa class-specific bugs?
yours in hope! Diggory.
Begin forwarded message:
From: Diggory Laycock <email@hidden>
Date: Sat Dec 08, 2001 02:42:20 pm Europe/London
To: email@hidden
Subject: NSOpenPanel and ".app" fileType and aliases
Hi list:
I am using the code below when I want the user to select an application from
their volumes.
It works, but if the user selects an alias to an application then the NSOpenPanel
thinks that the alias is a folder (a gray triangle points to the next pane)
also the following in the console: "FSOpenIterator failed:-1407"
The only reference to this error is at http://developer.apple.com/techpubs/
macosx/Carbon/Files/FileManager/File_Manager/ResultCodes/ResultCodes.html
and reads:
errFSNotAFolder -1407 : 'A parameter was expected to identify a folder, but
it identified some other kind of object (e.g., a file) instead. This implies
that the specified object exists, but is of the wrong type. For example, one
of the parameters to FSCreateFileUnicode is an FSRef of the directory where
the file will be created; if the FSRef actually refers to a file, this error
is returned.'
What am I doing wrong? should I re-write it to use file-type "APPL" instead?
Thanks, Diggory.
---------------------------------------------
{
int result;
MFICHelperApplication *theHelperApp;
NSArray *fileTypes = [NSArray arrayWithObject:@"app"]; // We Only want
to be able to select apps
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
[oPanel setAllowsMultipleSelection:NO];
[oPanel setResolvesAliases:NO]; // Changing this doesn't affect the
problem.
result = [oPanel runModalForTypes: fileTypes];
// equivalent to runModalForDirectory:file:types: method, using nil
for
both the filename and directory arguments.
// filename is the pre-selected file.
// directory is the starting directory - nil means the Applications
Directory.
if (result == NSOKButton) // If we didn't press cancel.
{
doStuffWithThePath...
_______________________________________________
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.