Re: Subclassing NSWindowController
Re: Subclassing NSWindowController
- Subject: Re: Subclassing NSWindowController
- From: Chaffinch <email@hidden>
- Date: Thu, 5 Dec 2002 14:16:56 +0000 (GMT)
Dietrich,
>
> Am I correct in thinking that I still need the loadDataRepresentation
>
> and dataRepresentaionOfType methods in the document class to load and
>
> save the document but that the actual displaying is now done by the
>
> window controller?
>
>
Let's go through the motions...
>
>
1) Document class. It should have the loading / saving /
>
window-creating code.
>
>
>
>
2) Subclass of NSWindowcontroller. Created like (in document class):
>
>
Any problems here? Part II: connections
Nope, basically thats what I have.
>
What do you mean by that loading & saving doesn't work? Specifics help,
>
such as 'Save' and 'Open' are disabled, or 'Save' doesn't write files.
Well, whereas previous to adding the NSWindowController subclass, I could
open an existing file and the contents are displayed in my window. Now I
select open existing doc and get a blank document. When saving I get an error
message "Can't save file".
>
If the last line is missing from above, 'save' should be disabled, and
>
opened documents should not show any data. How does your document read
>
the text? Through an IBOutlet or similar connection? This won't work
>
with window controllers, the connection will go to the window controller.
I do have an AddWindowController line, but apart from save not being
disabled, thats what I get. I am using an IBOutlet, and I think this is where
the problem is. The documentation is a bit patchy about how to change this. I
have moved the IPOutlet from my Document class to the window controller
class, but I am sure there is more to it than just that.
=====
Regards
Chaffinch
----------------------------------------------
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
_______________________________________________
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.