Re: KVO and relationships
Re: KVO and relationships
- Subject: Re: KVO and relationships
- From: Scott Stevenson <email@hidden>
- Date: Mon, 20 Nov 2006 20:11:04 -0800
On Nov 20, 2006, at 6:15 AM, David Aames wrote:
I've been looking more and more into bindings and I've been
thinking about
the case when the view observes the model via a controller - e.g. it
observes the keypath @"content.property". Now when the controller
handles
this call does it automatically observe @"property" and handle the
details
and emit a KVO message mapping the change in @"property" to @"
content.property" OR does this call retrieve [controller content]
and call
observe:... on the returned value? I think it is the former... but
what
would the experts say?
It might all be simpler than you think. Are you just curious how
bindings works or is there something you're trying to accomplish?
It's unusual to use "content.property" as a model keypath. You'd
usually just bind to "property" instead so that the controller can do
its job. It might make sense in your case, but there's no way to know
that without seeing some code from your project.
It might also be that I'm misunderstanding your question because
you're using terms which can have different meanings. For example,
it's not clear to me what what you mean by "call" in the first case:
"Now when the controller handles this call"
Do you mean an explicit call to -bind, or an explicit call to -
observeKeyPath, or an explicit call to -addObserver, or something
else? When you bind a view to a controller, you typically bind to the
controller itself, not the underlying object.
Also, I'd like to take this opportunity to make three requests for
people posting questions. Whenever possible, please:
1. Include sample code
2. Include what your high-level goal is
3. Include urls to screenshots if appropriate
(Could someone add these to the list faq? Pretty please?)
I find the most time-consuming part of answering questions is trying
to figure out what people are asking. The easier it is for others to
understand your question, more likely (and more quickly) it will be
answered.
Posts that roll on for a dozen sentences without any paragraph breaks
are not fun to read.
- Scott
_______________________________________________
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