Re: NSOpenPanel runModalForTypes: argument
Re: NSOpenPanel runModalForTypes: argument
- Subject: Re: NSOpenPanel runModalForTypes: argument
- From: Kai-Mikael Jää-Aro <email@hidden>
- Date: Fri, 23 Dec 2005 12:52:39 +0100
j o a r kirjoitti 2005-12-23 kello 12:23:
Hej,
On 23 dec 2005, at 12.15, Kai-Mikael Jää-Aro wrote:
Is it indeed the case that the allowed fileTypes argument is
different in the two methods, even though runModalForTypes: seems
to just be a wrapper for runModalForDirectory:? Indeed it seems
that only file extension strings are valid as arguments, I tried
[panel runModalForTypes: [NSArray arrayWithObjects: [NSNumber
numberWithUnsignedLong: 'MooV'], nil]] and got the message
2005-12-23 12:13:40.473 MakeRefMovie[17137] *** -[NSCFNumber
_getCString:maxLength:encoding:]: selector not recognized [self =
0x374010]
2005-12-23 12:13:40.511 MakeRefMovie[17137] *** -[NSCFNumber
_getCString:maxLength:encoding:]: selector not recognized [self =
0x374010]
The documentation indicates that you should encode HFS types like
this:
NSArray *fileTypes = [NSArray arrayWithObjects: @"txt", @"text",
NSFileTypeForHFSTypeCode( ‘TEXT’ ), nil];
<http://developer.apple.com/documentation/Cocoa/Conceptual/
AppFileMgmt/Tasks/UsingAnOpenPanel.html>
Would that work in your case? Have you tried it?
Ah, that, and
http://developer.apple.com/documentation/Cocoa/
Conceptual/LowLevelFileMgmt/Concepts/HFSFileTypes.html did the
trick. Thank you!
--
Kai-Mikael Jää-Aro <email@hidden>
Popwire AB +46 70 202 6494
Årstaängsvägen 19B
SE-117 94 Stockholm
Sweden
_______________________________________________
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