Hey all again,
Yet again looking for some wisdom, I am creating a smallish app that allows users to enter a path to a file say "~/Users/Docs" and on click of a button moves the folder and all its items to the trash.
Right now I have:
What I do not know is what I should put in the files part of the performFileOperation: It says in the documentation that this should be an array of items that you are working with, no path just an array of the items, but I do not know how to add just the folder to the array, is that even possible?
Any other hints/comments are as always thanked.
Thanks in advance,
Stephen
Yet again looking for some wisdom, I am creating a smallish app that allows users to enter a path to a file say "~/Users/Docs" and on click of a button moves the folder and all its items to the trash.
Right now I have:
Code:
NSInteger tag;
NSString *string = [textField stringValue];
NSArray *files = [NSArray arrayWithObject:string]; // Unsure what to put here
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:string destination:@"" files:files tag:&tag];
What I do not know is what I should put in the files part of the performFileOperation: It says in the documentation that this should be an array of items that you are working with, no path just an array of the items, but I do not know how to add just the folder to the array, is that even possible?
Any other hints/comments are as always thanked.
Thanks in advance,
Stephen