Problem using NSDocument
Problem using NSDocument
- Subject: Problem using NSDocument
- From: "Laurent Daudelin" <email@hidden>
- Date: Wed, 17 Oct 2001 12:39:30 -0400
OK,
Don't know if I'm stupid or something, but after reading about NSDocument,
NSWindowController and NSDocumentController, I thought I would be able to
quickly crank a small application to display pictures and set slide shows (I
have 8 years ObjC experience, and quite familiar with PB and IB).
So, I created this Cocoa Document-based project, modified the "MyDocument"
nib file to replace the textfield with an NSImageView, modified the
"MyDocument" class to add some code, specially to the
'loadDataRepresentation:ofType:' and I thought I was set. Wrong!
When 'loadDataRepresentation:ofType:' is called, my 'imageView' outlet is
nil! What is this? I did add this ivar as an IBOutlet in IB, connected it to
the NSImageView in the window, but it still comes as nil when
loadDataRepresentation:ofType: is invoked. I then did implement an
NSWindowController subclass, and it seems that nobody ever load the nib
file. Nowhere in the docs I've seen I was responsible for loading the nib
file and set the owner. I could certainly do that, but I thought the
NSDocument/NSWindowController/NSDocumentController mechanism would do that.
So, am I missing something?
-Laurent.
--
=====================================================================
Laurent Daudelin Developer, Multifamily, ESO, Fannie Mae
mailto:email@hidden Washington, DC, USA
********************** Usual disclaimers apply **********************
benchmark n.: [techspeak] An inaccurate measure of computer performance. "In
the computer industry, there are three kinds of lies: lies, damn lies, and
benchmarks." Well-known ones include Whetstone, Dhrystone, Rhealstone (see
h), the Gabriel LISP benchmarks (see gabriel), the SPECmark suite, and
LINPACK. See also machoflops, MIPS, smoke and mirrors.