[Openmcl-devel] Accessing objc properties

Neil Baylis neil.baylis at gmail.com
Mon Jul 6 05:36:33 UTC 2009


>
> ObjC "properties" define things that're very much like accessor  
> methods
> in CLOS; one difference is that they're a bit more opaque (the "slots"
> that those accessor methods access might be otherwise inaccessible.)
>
> If "foo" is the name of an ObjC property on some class, then in  
> general
> #/foo will be recognized as the name of a reader method that  
> accesses some state associated with the class and #/setFoo: would be  
> the name
> of the writer method that can be used to modify that state if that's
> allowed.
>
> In your case:
>
> (#/setOpacity: lyr 0.5)
>
Thanks Gary, I never would have figured that out, although I had a  
vague memory of that method working on objc as well. I tried it out  
just now, and it does of course.

I'm now correctly setting the name and opacity fields of CALayer, and  
then adding the layer to the containing view.

I have a few problems setting other properties of CALayer, but I'll  
see if I can resolve them myself.

Thanks,

Neil Baylis 



More information about the Openmcl-devel mailing list