Accessing NSError value
I have the following code as part of an application using the QTKit framework.
Earlier this week Martin Simmons had simple solution to access C variables.
I am wondering if there is also an easy solution to access NSError instances.
Thanks for any help.
Bruno
Here is the Objective-C code that I am trying to replicate with LW.
NSError *error;
QTCaptureDevice *videoDevice = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeVideo];
[videoDevice open:&error];
Here is the lisp code
(defvar nserror (objc:alloc-init-object "NSError"))
(defmacro define-string-constant (lisp-name objc-name)
`(dspec:def (define-string-constant ,lisp-name)
(fli:define-foreign-variable (,lisp-name ,objc-name)
:type objc:objc-object-pointer :accessor :read-only)))
(define-string-constant qt-media-type-video "QTMediaTypeVideo")
(defmethod default-video-device ()
(objc:invoke "QTCaptureDevice" "defaultInputDeviceWithMediaType:" (qt-media-type-video)))
(objc:invoke (default-video-device) "open:" nserror)