4

as the title says i wanna know how i can recognize that new file have been added to my App for example over an iTunes Sync. In iOS4 i used the methods

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

or

- (void)application:(UIApplication *)application didBecomeActive

But since iOS 5, this is useless because the app will not enter the Background and become active after a sync. It stays active. So is there a way to solve this?

regards

Ralf

4

2 回答 2

2

如果 iTunes 文件共享使用新的文件协调机制(尚未检查,但我认为确实如此),您可以实现NSFilePresenter协议以获取 Documents 目录中更改的通知。

通过实现和相关的方法,应该可以为整个目录使用单个文件呈现器(请参阅文档presentedSubitemDidAppearAtURL:中的“处理对呈现目录的更改” )。NSFilePresenter

于 2011-10-14T23:17:21.590 回答
0

通常我会创建一个计时器并定期检查与 iTunes 共享的目录中的新文件。我认为iOS5是最好的方法。

iOS5 可以通过 WiFi 同步,因此您无法控制何时将文件添加到目录

于 2011-10-14T23:09:46.330 回答