[Openmcl-devel] Accessing objc properties

Neil Baylis neil.baylis at gmail.com
Sun Jul 5 17:53:11 PDT 2009

I'm trying to translate the following snippet from a working objc  
program into lisp.

     CALayer* lyr            = [CALayer layer];
     lyr.opacity             = 0.5;

I think I managed to create the layer by doing:

(setf lyr (#/init (objc:make-objc-instance "CALayer")))

I'm trying to set the opacity by writing:

(setf (pref lyr :<CAL>ayer.opacity) 0.5)

This yields:

 > Error: Record type <CAL>AYER has no field named :OPACITY.
 >        Valid field names are:
 >        (ISA _ATTR)
 > While executing: CCL::%FIND-FOREIGN-RECORD-TYPE-FIELD, in process  

What's the correct way for me to set this property? Why would it be  
saying that CALayer has no such field?


Neil Baylis

More information about the Openmcl-devel mailing list