On Jun 4, 2008, at 4:10 PM, Alexander Hartner wrote:
1.) I gathered i have to create a new NSAutoReleasePool in my "threaded" method. Is this correct ?

Yes, every thread needs a separate AutoReleasePool. I don't know from the top of my head if NSThread creates one for you (I usually use pthreads and there you have to create your own).

2.) During execution of this I am updating the UI components from a thread which is not the main thread. This produces several error messages. How can I updated UI components. I tried using performSelectorOnMainThread, but this didn't work either. Not sure if this is the right approach.

Basic rule of threading on OS X: don't do any UI stuff whatsoever outside of the main thread.

3.) Is there an alternative way to achieve this without the beach ball appearing. I understand what caused it was the fact that I never exited the action method, at least not quickly. I would prefer an approach which did not require a new thread to be created.


Are you using blocking sockets to talk to the remote server? If so, using non-blocking sockets can help you do the entire communication based on events instead of polling.

-Stefan
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to