How do I set up an FTP connection?

2019-05-19 21:28发布

问题:

I am trying to setup an FTP connection using iPhone-iPad(Simulator)/Xcode. Up to this point I discovered I need to use the CFFTP API, but I have had no success.

I have browsed the net and ended up by following what seemed the most clear to me, that is : http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFFTPTasks/CFFTPTasks.html and : The O'Reilly site : .....oreilly.com/iphone/excerpts/iphone-sdk/network-programming.html

But even though, it seemed relatively clear at first view. I still haven't been able to make a working connection. Meaning download or upload a sample file.

One question I have for start : Is this possible on the Simulator ?

Another question is : It seems that my callback function is not called in the code I wrote by putting together the information I got from the two documents mentioned above. What are the possible reasons for this to happen ?

If you know about some sample code or tutorial showing the steps necessary to build an FTP connection and check that it works please let me know.

Thanks for any help.

回答1:

Without seeing code, it's difficult to comment on what could be causing a problem in your specific application.

I highly recommend looking at Apple's sample application SimpleFTPSample as a basis for building an application that uses FTP.



标签: iphone ftp