Notification callback in iOS when iTunes sync/file transfer is complete

懵懂的女人 提交于 2019-11-29 20:31:26

问题


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 class in the DocInteraction sample app

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

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

回答1:


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



来源:https://stackoverflow.com/questions/7850949/notification-callback-in-ios-when-itunes-sync-file-transfer-is-complete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!