[Openmcl-devel] Problems loading .nib file in CCL 1.2-rc1

Tord Romstad tord.romstad at gmail.com
Tue Apr 29 15:06:58 PDT 2008


I'm trying to do some Cocoa Lisp programming again, after a couple of
years of painful exile in Objective-C on a 32-bit Intel Mac.  To my
frustration, I discover that I no longer know how to load a .nib file
from the application bundle.  I've tried a very simple task: To load a
.nib file containing a single empty window and nothing else.  Here is
the procedure I have followed:

1. Open Interface Builder.  I choose "File -> New", and pick the
"Window" template to make my window.

2. Set the class of "File's Owner" to "NSWindowController", and
connect the "window" outlet to the window created in step 1.

3. Save the file, in the format "Interface Builder Cocoa Document (NIB 3.x)".

4. Start CCL, and do the following:

Welcome to Clozure Common Lisp Version 1.2-r9226-RC1  (DarwinX8664)!
? (require "BUILD-APPLICATION")
"BUILD-APPLICATION"
("builder-utilities" "BUILD-APPLICATION")
? (ccl::build-application :name "Test" :directory
"/Users/tord/Desktop" :nibfiles
'("/Users/tord/Documents/Programs/Lisp/Test/Test.nib"))

5. Double-click the Test.app icon on the desktop.

6. In the listener window, I type:

? (setf *wc* (#/initWithWindowNibName: (#/alloc (find-class
'ns:ns-window-controller))
                                       #@"Test.nib"))
#<NS-WINDOW-CONTROLLER <NSWindowController: 0x125d1240> (#x125D1240)>

7. Nothing happens.  I inspect the value of the 'window' slot in my
NSWindowController, and get a null pointer:

? (#/window *wc*)
#<A Null Foreign Pointer>

Meanwhile, I get the following message in the console window:

2008-04-30 00:02:39.193 Test[86722:21303] -[NSWindowController
loadWindow]: failed to load window nib file 'Test.nib'.

When I inspect the application bundle, the Test.nib file is there, at
the expected location (Contents/Resources/English.lproj/Test.nib).

What am I doing wrong?

Tord



More information about the Openmcl-devel mailing list