[Openmcl-devel] initializing objects that are created elsewhere
alexcrain at mail.widgetworks.com
Sun Jan 9 17:46:24 UTC 2005
My question about loading from nib files has turned into a more general
Any time an object is created on the OBJC side, it is not properly
initialized on the lisp
side, which means that if there are lisp slots, they don't get set up
unless I do it explicitly.
My latest example is with NSDocuments, which are created through the
I have something like this:
(defclass ide-editor-document (ns:ns-document)
(window-controller-class :initform 'hemlock-window-controller
(textstorage :initform nil :accessor document-text-storage)
(defmethod initialize-instance :after ((doc ide-editor-document) &rest
(declare (ignorable initargs))
(setf (slot-value doc 'nib-name) "ide-editor")
Which is fine if use MAKE-INSTANCE, but if I have IdeEditorDocument as
a value in the
Info.plist file, then clicking File->New causes OBJC to create the new
object and all I get
is a pointer to an uninitialized lisp object: no slots and
INITIALIZE-INSTANCE is never run.
In this case I just added (INITIALIZE-INSTANCE self) to the
but the programmer shouldn't have to figure out if an object has been
initialized or not.
Somewhere, there is code that maps the external MACPTR to an object
structure. That code
knows what the object is and whether it already exists, so it should be
able to handle this job.
Can anyone give me a hint as to where to look?
More information about the Openmcl-devel