[Openmcl-devel] Problem with Interface Builder bindings

Didier Verna didier at lrde.epita.fr
Thu Feb 28 07:57:33 PST 2008


       Hello,

I have a problem with IB that I don't understand (I had a hard time
figuring it out). I have a nib file with an NSCollectionView governed by
an NSArrayController.

The File's Owner is defined like this:

(defclass collection-view-controller (ns:ns-view-controller)
  ((items :documentation "The items in the collection view."
	  :foreign-type :id
	  :accessor items
	  :initarg :items))
  (:metaclass ns:+ns-object)
  (:documentation "The COLLECTION-VIEW-CONTROLLER class."))

[ BTW, in order to let IB know that the class of the File's Owner is a
  subclass of NSView, I had to write a fake .h file with an equivalent
  definition and have IB read it. Not sure if it's the way to go... ]

Now in the nib file, section "Array Controller Bindings", there is a
"Controller Content -> Content Array" section which I have set as follows:

Bind to: File's Owner
Model Key Path: items

so that the NSArrayController's contents tracks the "items" slot. This
is exactly how it works in an equivalent Objc code that I have, but
unfortunately, it doesn't work with my Lisp implementation: I figured
that the NSArrayController's content is always empty, so it doesn't
appear to "track" the items in the collection-view-controller. If
however I explicitely set its contents to the same thing via a call to
#/setContent:, then I can see my items appear.

Any idea where the problem is ?

Thanks !

-- 
5th European Lisp Workshop at ECOOP 2008, July 7: http://elw.bknr.net/2008/

Didier Verna, didier at lrde.epita.fr, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire   Tel.+33 (0)1 44 08 01 85
94276 Le Kremlin-Bicêtre, France   Fax.+33 (0)1 53 14 59 22  didier at xemacs.org



More information about the Openmcl-devel mailing list