I was wondering if there is a way to programmatically empty the contents of the trash bin. I'm currently deleting files that are located there using:
NSFileManager *manager = [NSFileManager defaultManager];
[manager removeItemAtPath:fileToDelete error:nil];
However, after I use this operation, every time I drag a file to the trash, I am prompted with the message:
Are you sure you want to delete “xxxxxx.xxx”?This item will be deleted immediately. You can’t undo this action.
This lasts until I either log out or sudo rm -rf the trash bin.
Thanks!