Skip navigation.
 
mlRe: Correct use of NSViewController
FROM : Jonathan Dann
DATE : Thu Mar 20 02:19:58 2008

Hi Cathy,

Thanks for the comprehensive answer to my question, I wanted to make 
sure that I wasn't committing heresy by going down the 'tree of view 
controllers' road before jumping in and refactoring all my code.  I 
was hoping to set it up so I could forget about most of the memory 
management as I'm replacing views all over the place at runtime.

Out of interest, when I add my main split view, I then have to set its 
size to fit my document window's content view.  As this task is view-
related it seems like it the split view's NSViewController should 
handle the size calculation and placing of the view in the correct 
place in the window.  I allocate and instantiate my view controller in 
my NSWindowController subclass, then set the split view as a subview 
of the content view and then  in the -awakeFromNib of the view 
controller I get the split view's superview's (the content view's) 
frame, doing my resiing from there.

Would you do the same, as this seems to encapsulate the logic 
properly, or would you just set it all in the window controller?

Thanks again, you've been really helpful.

Jonathan

Related mailsAuthorDate
mlCorrect use of NSViewController Jonathan Dann Mar 19, 12:37
mlRe: Correct use of NSViewController Cathy Shive Mar 19, 13:19
mlRe: Correct use of NSViewController Jonathan Dann Mar 20, 02:19
mlRe: Correct use of NSViewController Cathy Shive Mar 20, 08:40
mlRe: Correct use of NSViewController Jonathan Dann Mar 20, 12:35
mlRe: Correct use of NSViewController Cathy Shive Mar 20, 13:29
mlRe: Correct use of NSViewController Paul Szego Mar 20, 23:27
mlRe: Correct use of NSViewController Jonathan Dann Mar 21, 21:49
mlRe: Correct use of NSViewController Cathy Shive Mar 21, 22:31
mlRe: Correct use of NSViewController Steve Weller Mar 22, 04:25
mlRe: Correct use of NSViewController Steve Weller Mar 22, 04:31
mlRe: Correct use of NSViewController Cathy Shive Mar 22, 05:18