Porting a file browser to the mac app store. (Its been there ~10 years, now trying to sandbox it!) (Leap/Yep)
startAccessingSecurityScopedResource - works fine everywhere, except if I ask the user for permission to browse their root folder, then I can show them their files from everywhere except their Desktop folder, IF the Desktop folder is setup to be on the iCloud.
Feels like a bug, as I can find no documentation that says that startAccessingSecurityScopedResource will fail for certain subfolders.
How would I find all the subfolders that wont work? And how to give the user what they want, which is 'all files' listed...
startAccessingSecurityScopedResource - works fine everywhere, except if I ask the user for permission to browse their root folder, then I can show them their files from everywhere except their Desktop folder, IF the Desktop folder is setup to be on the iCloud.
Feels like a bug, as I can find no documentation that says that startAccessingSecurityScopedResource will fail for certain subfolders.
How would I find all the subfolders that wont work? And how to give the user what they want, which is 'all files' listed...
-Tom
Code Block // get url from standard NSPanel stuff... [url startAccessingSecurityScopedResource]; // say url is file:///Users/myhome #if KP_DEBUG NSError* errorHere = nil; NSArray* allFilesAndFolders = [[[NSFileManager alloc] init] contentsOfDirectoryAtPath:[url path] error:&errorHere]; // no error NSArray* allFilesAndFolders2 = [[[NSFileManager alloc] init] contentsOfDirectoryAtPath:@"/Users/myhome/Desktop" error:&errorHere]; if (errorHere) // always the permission denied here NSLog(@"Error in searching2 %@", errorHere); errorHere = nil; NSArray* allFilesAndFolders3 = [[[NSFileManager alloc] init] contentsOfDirectoryAtPath:@"/Users/myhome/Documents" error:&errorHere]; if (errorHere) // NO error here, I can see the Documents NSLog(@"Error in searching3 %@", errorHere); NSLog(@"Items found %@, %@, %@", allFilesAndFolders, allFilesAndFolders2, allFilesAndFolders3); #endif