Re: How to implement while there are objects in the array - run runloop idea?

2011-05-29 Thread Nick
Thanks for the ideas! ___ 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:

Re: How to implement while there are objects in the array - run runloop idea?

2011-05-26 Thread Stephen J. Butler
On Thu, May 26, 2011 at 12:56 PM, Nick eveningn...@gmail.com wrote: I have a custom (not main) thread, that adds objects to an NSArray at random times. I have an another thread (main thread) that has to retrieve these objects and do something with them (extract some properties from the

Re: How to implement while there are objects in the array - run runloop idea?

2011-05-26 Thread Jens Alfke
On May 26, 2011, at 10:56 AM, Nick wrote: I have a custom (not main) thread, that adds objects to an NSArray at random times. ... Is there any way to make the RunLoop (after it has processed all NSUrlConnection's asynchronous things) check, if there are some objects in my NSArray queue,

Re: How to implement while there are objects in the array - run runloop idea?

2011-05-26 Thread Ken Thomases
On May 26, 2011, at 1:35 PM, Stephen J. Butler wrote: - Use NSNotifications to notify that a new object is waiting to be processed. If you go this route, you could actually have multiple processing threads all listening for the notification. Notifications are delivered on the same thread as

Re: How to implement while there are objects in the array - run runloop idea?

2011-05-26 Thread Stephen J. Butler
On Thu, May 26, 2011 at 1:35 PM, Stephen J. Butler stephen.but...@gmail.com wrote: You might want to abandon that approach and not add objects from the background thread directly to the shared array. Instead, you could signal the main thread that a new object is ready to be processed. Some