Skip navigation.
 
mlRe: Correct use of NSViewController
FROM : Jonathan Dann
DATE : Thu Mar 20 12:35:14 2008

>

Hi Cathy,

Thanks again for your advice. I've got it working now and I'm almost 
back I where I was before refactoring, I'm now running into a bindings 
problem.

Before using the view controllers I had put 2 tree controllers in my 
window controller's nib, 2 outline views were then bound to these and 
the tree controllers themselves got their content from an object 
controller that was bound to the the keypath [(Window Controller)
File's Owner].document. So the object controller was a proxy for my 
document and the tree controllers had shorter keypath to traverse to 
get to the array they needed in my document subclass.

Now when I do this I have the tree controllers and the document proxy 
object controller in my view controller's nib. The only way I can see 
to getting to the document is using the keypath

[File's Owner].view.window.windowController.document

However this does not work, seems convoluted, and I get the following:

KVO autonotifying only supports -set<Key>: methods that return void. 
Autonotifying will not be done for invocations of -[NSSplitView 
_setWindow:]

So my view controller needs to know about its 'owning' document 
somehow and I can't see how to get it.

Have you run into this. I'm not sure getting the current document from 
the document controller will work as that will change ad the user 
opens more documents.

Thanks again,

Jon

P.S. Out of interest, what do you develop?

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