iTunes 同步/文件传输完成时 iOS 中的通知回调 [英] Notification callback in iOS when iTunes sync/file transfer is complete

查看:16
本文介绍了iTunes 同步/文件传输完成时 iOS 中的通知回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了如何在文件系统发生更改时在 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.

DocInteraction 示例应用中的DirectoryWatcher 类

DirectoryWatcher class in the DocInteraction sample app

http://developer.apple.com/library/ios/#samplecode/DocInteraction/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010052

是否可以进行 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 代码并进行了一些修改以轮询文件大小.https://github.com/hwaxxer/MHDirectoryWatcher

I took the DirectoryWatcher code and made some modifications to poll the file sizes. https://github.com/hwaxxer/MHDirectoryWatcher

这篇关于iTunes 同步/文件传输完成时 iOS 中的通知回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆