I have an NSView drop box, which allows the user to drag and drop a folder. I don't want them to drag and drop the very folders like ~ Movies, ~ Music, ~ Desktop... inside User's folder. If I run the following code, what I get is a movies folder assigned to my sandboxed application. That's not what I want.
NSURL *url = [[NSURL alloc] init];
url = [[[NSFileManager defaultManager] URLsForDirectory: NSMoviesDirectory inDomains:NSUserDomainMask] lastObject];
NSLog(@"%@",[url path]);
I can get the right folder with 'url' above by repeating stringByDeletingLastPathComponent several times. But is there a simpler way of getting that folder? And is there a way of preventing the user from using those folders right inside the local user folder altogether?
Mucho thankos