开发者

Ftp multiple file transfer

开发者 https://www.devze.com 2023-01-15 20:37 出处:网络
How can I wait the end of an ftp transfer on my iPhone app, if I have to do many ftp transfers in sequence?

How can I wait the end of an ftp transfer on my iPhone app, if I have to do many ftp transfers in sequence?

I call the same method to make the transfers, changing the name of file.

[Ftp receiveFtp:fi开发者_开发技巧le1]; [Ftp receiveFtp:file2]; [Ftp receiveFtp:file3];

Here, for example, I should wait the end of the first method before calling the second. Any ideas?

Thanks, Andrea


I guess Ftp is doing its work on another thread, or you would not ask how to wait for a method to terminate to execute it's follower ?

if that assumption is true, then I suggest you make a protocol method that will tell to your delegate (your parent class) that the ftp transfer has finished, which will start the following file.


Put all your filenames in a collection (i.e. NSMutableArray), and in your handler for a completed download, pop the next one from the array and start the next download as long as the list isn't empty.

0

精彩评论

暂无评论...
验证码 换一张
取 消