NSOpenPanel setDirectory to a package
NSOpenPanel setDirectory to a package
- Subject: NSOpenPanel setDirectory to a package
- From: Dale Jensen <email@hidden>
- Date: Wed, 18 Jun 2008 17:18:08 -0500
I have an "application picker" bit in my preferences, which allows the
user to select an app to do something. 90% of the time, I presume,
this will be a package, not a single file. My code is thus:
[oPanel setTreatsFilePackagesAsDirectories: NO];
NSString *filePath = @"/Applications/Preview.app"; // just for
example, it doesn't really default this way
[oPanel setDirectory:filePath];
I think those are the only relevant bits. When then open panel comes
up, the application is selected, and you're looking at the root level
of the package (ie: "Contents"). That's not what I want, and not what
I think the above code should result in. I think that it should show
the applications folder, with Preview selected (but not "open" to the
Contents folder.)
If you follow a similar process in Safari to change the default RSS
reader in Preferences > RSS, it performs as expected, so there must be
a way to get it working, but it doesn't seem obvious.
Thanks for any pointers!
dale
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden