I am looking for a reliable way to get a notification if the user has modified the contents of the document directory via itunes file sharing while the app is running.
I rather not use
- (void)applicationDidBecomeActive:(UIApplication *)application
because this is not reliable with iOS 5 because you can change the documents directory without this method being called..
I have also looked into Apple’s DirectoryWatcher class and found that it does not work on iOS 4.3 and later.
Edit:
As per the answer below this DirectoryWatcher does infact work, i had just missed that it is by default autoreleased.
Apple’s DirectoryWatcher looks good. I haven’t fully tested it but from a cursory look…
You have to upgrade it to iOS5 – but XCode prompts you to do this. This results in a project with one error which can be resolved by adding the QLPreviewControllerDelegate to DITableViewController interface.