On Jun 24, 2009, at 2:28 AM, Ken Thomases wrote:

You probably don't need to use a background thread to do FTP. You can do it using asynchronous methods on the main thread. Since you can, you probably should. It's almost always less error prone and even more efficient.

Considering the GUI operations, I use the background thread to do FTP.

How are you pausing and resuming the download?
As you said, through controlling this from the GUI, when user click the
pause button, I will stop receiving the data in the background and exit the
thread.

Doing it the "naive" way will get you in trouble.
In fact, In Windows platform, I control it successful with the same methods.
 Maybe it is really "naive" way in the Mac platform.


You should launch the program in the debugger, instead -- use Debug instead of Run. That way, it will reliably show you the proper thread in the event of a crash.
According to your suggestion, I will try to do it.

Thanks.

Regards,
Chris


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to