Re: KVO notifications and threads
Re: KVO notifications and threads
- Subject: Re: KVO notifications and threads
- From: Jerry Isdale <email@hidden>
- Date: Tue, 15 Jul 2008 11:45:00 -0700
So I'm a bit confused by the ability to do bindings in IB, but if the
data is updated anywhere but on the MainThread, your program may be in
trouble.
This kinda blows out the use of KVO bindings in the UI to me.
If data comes in over the network, then the receiving tool must do the
actual set calls on the MainThread.
that or we use something completely different.
If data is used as the left side (assignment) in a calculation, then
the calculation must stop and do that assignment on MainThread, wait
for its completion, and then restart.
So what probably happens is that you have two models... one that is
the real data calculation, and one that gets updated on the main
thread. It would be the latter that actually gets observed.
That is -
1) network receiver captures packets, updates CalculationModel,
possibly invoking calculation action
2) calculation function does its stuff, updating the CalculationModel
3) calculation model creates a Dictionary of all updated variables
4) calculation model invokes a selector on main thread to update View
Model using dictionary
5) main thread executes update selector
6) updates trigger KVO of View objects
Means we have at least three copies of the data shuffling around
memory, but hey thats why we buy machines with 2-4 Gb of ram.
and multiple processors/cores that sit idle (or run adobe updater in
the background)
Jerry Isdale
email@hidden
_______________________________________________
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