Re: File's Owner
Re: File's Owner
- Subject: Re: File's Owner
- From: Scott Anguish <email@hidden>
- Date: Sun, 25 May 2008 03:49:02 -0400
On May 25, 2008, at 3:15 AM, Johnny Lundy wrote:
Well, tell that to the guy who wrote the Currency Converter Using
Bindings tutorial. See the last sentence here:
"This concrete example should help you understand what the value
binding’s configuration implies: The content of the text field is
bound to the value of the exchangeRate key, which Cocoa bindings
finds on the model object using key-value coding. Cocoa bindings
knows to look for that key in the model object that is bound to
thecontent outlet of the controller specified by the Bind to aspect—
in this example, the controller is theNSObjectController instance
you configured earlier, whose content outlet points to the Converter
object you instantiated in the nib file."
And you wonder why I am still confused. That paragraph from Apple
directly contradicts what you just said.
In a real application of any substance you'd likely create your model
object dynamically (from saved data or a new state which you intend to
be able to save and load in the future).
In this _specific_ example (which is what that last sentence says) the
model object is being instantiated in the nib. This is because the
creation of the model object isn't what the example is attempting to
show... it's the connections between the objects and creating them in
IB.
(it isn't a particularly extensive bindings example (purposely), it is
out of date (old Xcode and IB), and needs a total rewrite and
expansion...)
On May 25, 2008, at 2:12 AM, email@hidden wrote:
My NSArrayControllers can be bound to model objects without anything
going through File's Owner.
Really? That implies that your model is contained within the nib,
which is not how MVC is supposed to work. The nib should contain the
V (View) and possibly C (Controller) parts of MVC, but it should not
contain the M (Model).
_______________________________________________
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
_______________________________________________
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