Re: How to Delay, Wait, Pause...
Re: How to Delay, Wait, Pause...
- Subject: Re: How to Delay, Wait, Pause...
- From: Steve Steinitz <email@hidden>
- Date: Sun, 25 May 2008 21:46:05 +1000
Hi Dimitri,
Thanks for your insightful reply.
On 25/5/08, Dmitri Goutnik wrote:
Have to agree with Thomas that delay is the wrong way to handle this.
Yes, he makes a good point.
From 10.4 on fetch: results are delayed until the next iteration of
the run loop so (please correct me if I'm wrong) the simplest solution
would be to just manually iterate through the loop twice:
[arrayController fetch:nil];
[[NSRunLoop mainRunLoop] runUntilDate:[NSDate distantPast]]; // finish current iteration
[[NSRunLoop mainRunLoop] runUntilDate:[NSDate distantPast]]; // iterate one more time to allow selection to update
NSUInteger selection = [arrayController selectionIndex];
Yes! It works perfectly and seems nearly instantaneous. Thank
you for cutting right to the core of the issue. Bravo.
I'm thinking I may be able to use your technique to solve other
niggly problems I've had.
Thank you again to all of you who contributed to this thread.
All the best,
Steve
_______________________________________________
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