问题描述
我已经在文件系统发生变化时搜索了如何在iOS5中接收回调。我在Apple的网站上找到了以下示例,但它只在删除/创建文件时通知给定的代理。
I have searched for how to receive callbacks in iOS5 when the file system has changed. I've found the following sample from Apple's site, but it only notifies the given delegate when a file is removed/created.
我是否可以通过API调用来接收同步完成回调事件?请注意,用户可能会传输大文件,我需要知道传输何时完成。此外,在iOS5中,iTunes同步可以在后台进行,这意味着您的应用程序不一定会离开前台;因此不会调用此方法:
Is there an API call that I can make to receive a "sync is complete" callback event? Note, a user might transfer large files and I need to know when the transfer is complete. Also, in iOS5, iTunes sync can occur in the background, meaning that your application doesn't necessarily leave the foreground; hence this method is not called:
- (void)applicationDidBecomeActive:(UIApplication *)application
推荐答案
我使用了DirectoryWatcher代码并进行了一些修改以轮询文件大小。
I took the DirectoryWatcher code and made some modifications to poll the file sizes. https://github.com/hwaxxer/MHDirectoryWatcher
这篇关于iTunes同步/文件传输完成后,iOS中的通知回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!