Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOpenPanel shouldShowFilename delegate, or how to display a list of applications



Dear All,

This throws up a open panel that selects only applications:

[openPanel
runModalForDirectory: nil
file: nil
types: [NSArray arrayWithObjects: @"app", NSFileTypeForHFSTypeCode
('APPL'), nil]]

Nice and dandy. But I want to limit these to those apps that can open a
certain type of file, so presumably I set the open panel's delegate and
handle the panel:shouldShowFilename: message.

Unfortunately I'm a little stuck...

1. The delegate gets this message for all files and directories.
2. How do I tell whether a particular filename is a regular directory
or .app bundle?
3. If I can figure out #2, then I suppose I could use LSCanURLAcceptURL
to determine whether the app accepts the file. I can make the required
CFURLRefs using CFURLCreateWithFileSystemPath, but this function wants
me to tell it whether the file path is really a directory?



Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
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.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.