Skip navigation.
 
mlRe: Updating all bindings manually
FROM : Bill Bumgarner
DATE : Sun Jun 04 17:46:33 2006

On Jun 4, 2006, at 5:21 AM, Moray Taylor wrote:
> Is it possible to update all bindings manually?
>
> I know you can do something like
>
>    [self willChangeValueForKey:@"key"];
>    [self didChangeValueForKey:@"key"];
>
> But I'd have to do that for all my bindings (50+), and update the 
> list every time I added a binding.
>
> What I'd like is either be able to ask the Nib (or controller, or 
> whatever) for a list of it's bindings and then iterate through them.
>
> I'm sure I've seen this done, but I've googled and can't find any 
> sign of it, maybe I dreamt it.


It really sounds like you are trying to work around a bug in your 
code.  In particular, bindings should never get out of sync with the 
underlying model objects unless the model objects have custom setters/
getters that don't implement the correct willChange/didChange behavior.

If it is a case of "key 'a' changes, 'b' needs to update", KVO has a 
mechanism for configuring dependent keys.

So, question, why do you need to do this?

b.bum

Related mailsAuthorDate
mlUpdating all bindings manually Moray Taylor Jun 4, 14:21
mlRe: Updating all bindings manually Bill Bumgarner Jun 4, 17:46
mlRe: Updating all bindings manually mmalcolm crawford Jun 4, 19:57