Controllers and Views
Controllers and Views
- Subject: Controllers and Views
- From: Tim Conkling <email@hidden>
- Date: Thu, 15 Jul 2004 20:35:45 -0400
Hello list,
I'm a brand new cocoa-dev subscriber. I'm a long time C++ developer and
I've worked a fair amount with Carbon (and the Classic Mac OS APIs).
I'd never used Objective-C before the beginning of this week, but I
have a copy of Aaron Hillegass' Cocoa Programming book (the newer 2nd
edition) and I've been working my way through it for the past three
days. I'm sure everyone here has heard Obj-C newbies say this a lot,
but I'm very impressed with the language and its incredible flexibility
thus far. I've also only ever used Codewarrior for app development
before this week, but Xcode and Interface Builder (which I've used, to
a much lesser extent, for Carbon development) are quickly growing on me
(I'd messed around with Project Builder a bit in the past but didn't
feel it was good enough to replace my paid copy of CW).
I have a question that comes directly from the Cocoa book, but
familiarity with the book is not necessary for an answer. In Chapter 6,
Hillegass introduces NSControllers, and has the reader use IB to make
an NSArrayController to hold a collection of user-defined objects. The
contents of the contoller are reflected in an NSTableView by way of
some bindings from the columns of the NSTableView to the
NSArrayController. The magical part that I can't quite wrap my head
around is that, when the NSArrayController has an object added to or
deleted from it, the NSTableView immediately reflects the changes,
though I never made any binding from NSArrayController to the
NSTableView. How does the array know about the table view? Do bindings
somehow work both ways automatically?
From a brief web search, it seems to me that there is (or has been)
some controversy about these controllers among the Cocoa community. I
hope I'm not bringing up an unhappy topic in my first post...
Thanks for any help,
Tim Conkling
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.