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, and if there are - to initiate new NSURLConnections, if
> there are not, and if there are no other events pending, just 'block', as
> the runloop always does?

The background thread needs to do something to wake up the main runloop after 
it adds an object to the array. Calling -performSelectorOnMainThread: would be 
an ideal way to do this. If you do that, you may not even need to use an array 
to queue the objects; instead just pass each object to the main thread as the 
parameter to that perform.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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