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

查看:264
本文介绍了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.


DirectoryWatcher类在DocInteraction示例应用程序中

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天全站免登陆