How to implement "while there are objects in the array - run runloop" idea?
How to implement "while there are objects in the array - run runloop" idea?
- Subject: How to implement "while there are objects in the array - run runloop" idea?
- From: Nick <email@hidden>
- Date: Thu, 26 May 2011 20:56:46 +0300
Hello
Could you please give me an idea how to implement this task?
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 retrieved
object and make an NSURLConnection's asynchronous connection).
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?
Or, if there is no way to do this using the runloop itself, what would be
the most natural way to solve such a task? I am stuck at this.
Thank you!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden