• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bindings between nib files (again)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings between nib files (again)


  • Subject: Re: Bindings between nib files (again)
  • From: Keary Suska <email@hidden>
  • Date: Fri, 01 Dec 2006 11:21:16 -0700
  • Thread-topic: Bindings between nib files (again)

on 12/1/06 12:22 AM, email@hidden purportedly said:

> This is not the case.  Bindings should be made -- through controllers
> -- from view objects to model objects.

This is, conceptually, more accurate wording, but not quite precise.
According to the documentation for bind:toObject:withKeyPath:options:

- (void)bind:(NSString *)binding toObject:(id)observableController
withKeyPath:(NSString *)keyPath options:(NSDictionary *)options

So, the expectation is that you are binding to a controller object, although
your controller could be bound to a model (or another controller). But a
view isn't bound to a model. A view is bound to a controller through which a
model's information may be accessed.

My point was that the relationship should be model<->controller<->view, and
more precisely, that bindings establish a (direct) relationship between only
two objects. To speak of model<->view relationships is misleading. Except
for view-controller or model-controller objects, but that's another
discussion.

<snipping out my boneheaded statements and discussions that seems to hinge
around (more) semantics>

> Access to model objects should be mediated by controllers; if you bind
> a view to a key-path via a controller object, the view doesn't care
> where the destination model objects came from.

Leads to my main point--there is no direct or necessary connection between
models and views. Therefore a view cannot be bound to a model. The
controller could swap out the model object at any time and the view would be
none the wiser, and nothing would get "unbound".

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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

  • Prev by Date: Re: Re: NSImage TIFFRepresentation memory leak
  • Next by Date: Re: Bindings: changing model changes some views but not others (NSTableColumn)
  • Previous by thread: Re: Reading the XML in Pages index.xml.gz
  • Next by thread: Re: Bindings between nib files (again)
  • Index(es):
    • Date
    • Thread