mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 06:12:24 +00:00
Using NSFileManager to locate URL for Applications
This commit is contained in:
@@ -51,7 +51,8 @@
|
|||||||
|
|
||||||
- (void)showCustomBrowserSelection:(id)sender {
|
- (void)showCustomBrowserSelection:(id)sender {
|
||||||
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
|
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
|
||||||
[openPanel setDirectoryURL:[NSURL URLWithString:@"/Applications"]];
|
NSURL *applicationURL = [[NSFileManager defaultManager] URLsForDirectory:NSApplicationDirectory inDomains:NSSystemDomainMask][0];
|
||||||
|
[openPanel setDirectoryURL:applicationURL];
|
||||||
[openPanel setAllowsMultipleSelection:NO];
|
[openPanel setAllowsMultipleSelection:NO];
|
||||||
[openPanel setCanChooseDirectories:NO];
|
[openPanel setCanChooseDirectories:NO];
|
||||||
[openPanel setCanChooseFiles:YES];
|
[openPanel setCanChooseFiles:YES];
|
||||||
|
|||||||
Reference in New Issue
Block a user