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 (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 [EMAIL PROTECTED]