Re: Can't open specified type in NSOpenPanel
Re: Can't open specified type in NSOpenPanel
- Subject: Re: Can't open specified type in NSOpenPanel
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 23 Feb 2004 11:19:47 -0800
On Feb 23, 2004, at 9:01 AM, Randall Meadows wrote:
Given the snippet of code:
[...]
[panel beginSheetForDirectory:nil file:nil types:[NSArray
arrayWithObjects:@"asdf", nil] modalForWindow:setupWdw
modalDelegate:self
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
why are my files with an HFS type of "asdf" (no extension) NOT
selectable in an Open panel?
Because "types" has to be one of these two (I'm not sure which right
now):
[NSArray arrayWithObjects:NSFileTypeForHFSTypeCode('asdf'), nil];
or
[NSArray arrayWithObjects:[NSNumber numberWithUnsignedLong:'asdf'],
nil];
One of those ought to work; the documentation isn't too clear on this.
But using the type "asdf" as you used it above only works if the file's
extension is "asdf"; it doesn't work for creator codes.
Nick Zitzmann
<
http://seiryu.home.comcast.net/>
<
http://www.freshlysqueezedsoftware.com/>
S/MIME signature available upon request
UNIX: Where /sbin/init is Job #1.
_______________________________________________
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.