Looking for timer like functionality without NSTimer
Looking for timer like functionality without NSTimer
- Subject: Looking for timer like functionality without NSTimer
- From: Mike Zornek <email@hidden>
- Date: Wed, 11 May 2005 17:03:53 -0400
So I'm using UnitKit to test an App I'm building. In one of the test I need
to create an object that is put into a queue. This object contains a URL to
a website resource.
In my test I create the object, set it's url, put it in the queue and tell
it to start processing. I need to test the results of this processing, but
because it involves asynchronous NSURLConnections I can't test for the
results immediately after sending the message. I need to wait.
Firstly, I don't think I want to switch to synchronous NSURLConnections, as
I believe they would pause my whole app and it's interface while waiting for
the data.
So, I tried to create a NSTimer to poll the data store (a core data context
in my app) for a flag that notes when the queue is done processing. This
doesn't seem to work too well since I don't think the UnitKit test run in a
runloop suitable for NSTimers. My early experimentation shows my selector
never getting called.
I could wrap the polling in a while loop but these seems like it might be
hard on the data store. I can hear the kids now, "are we there yet? are we
there yet? are we there yet?".
Perhaps I can do a while, with some kind of pause, that wouldn't effect the
NSURLConnection stuff?
Any suggestions are appreciated. Thanks!
~ Mike Zornek
-----
Shameless promotion
Personal site: <http://MikeZornek.com>
Philly Apple Devs: <http://PHAD.org>
ADHOC / MacHack (July 27-31): <http://www.adhocconference.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden