mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 10:32:26 +00:00
Using NSFileManager to locate URL for Applications
This commit is contained in:
@@ -51,7 +51,8 @@
|
||||
|
||||
- (void)showCustomBrowserSelection:(id)sender {
|
||||
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 setCanChooseDirectories:NO];
|
||||
[openPanel setCanChooseFiles:YES];
|
||||
|
||||
Reference in New Issue
Block a user