Re: Advise on referencing NSDocument from custom view

2014-08-13 Thread Luc Van Bogaert
I've reworked my model, view and controller classes in the way you've indicated below. Thanks. I do have another question about this kind of setup. In the process I decided that it would be a good idea to have a designated initializer for my custom view that sets a reference to the model

Re: Advise on referencing NSDocument from custom view

2014-08-13 Thread Quincey Morris
On Aug 13, 2014, at 11:31 , Luc Van Bogaert luc.van.boga...@me.com wrote: My question now is , where I should remove MyView as an observer with 'self.model removeObserver: self forKey: @property...' '? I tried to do this in 'dealloc', but it seems that from time to time my model object is

Advise on referencing NSDocument from custom view

2014-08-10 Thread Luc Van Bogaert
Hello, I'm creating a document-based drawing application and I'm looking for some expert advice on the approach to take for referencing my document from a custom view that will draw itself based on the data that is stored in the document object. My custom view, which you could see as a kind of

Re: Advise on referencing NSDocument from custom view

2014-08-10 Thread Quincey Morris
On Aug 10, 2014, at 09:01 , Luc Van Bogaert luc.van.boga...@me.com wrote: I was thinking of using a weak property for my custom view to reference the document and set this property from the same windowDidLoad: method, but I'm not sure if this is a good approach to take. Any advise on this?

Re: Advise on referencing NSDocument from custom view

2014-08-10 Thread Luc Van Bogaert
On 10 Aug 2014, at 19:15, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Aug 10, 2014, at 09:01 , Luc Van Bogaert luc.van.boga...@me.com wrote: I was thinking of using a weak property for my custom view to reference the document and set this property from the same

Re: Advise on referencing NSDocument from custom view

2014-08-10 Thread Quincey Morris
On Aug 10, 2014, at 13:16 , Luc Van Bogaert luc.van.boga...@me.com wrote: Let's see if I understand this correctly: do you mean I could create a separate model class, eg. Drawing with all of it's properties and reference this in my document class as an instance variable or even as a