Re: Accessing CALayer properties
Re: Accessing CALayer properties
- Subject: Re: Accessing CALayer properties
- From: Antonio Nunes <email@hidden>
- Date: Sun, 28 Oct 2007 17:36:52 +0100
On 28 Oct 2007, at 15:53, Jesus De Meyer wrote:
I'm testing the new CoreAnimation framework but I can't access or
even set the properties of the CALayer object.
The code I'm using is this:
CGPoint pt = layer.position;
Instead of this working, I get the following error: request for
member 'position' in something not a structure or union.
How have you declared the layer variable? If you declared it as a
CALayer then it should work. If you declared it as type id then you
will get this complaint (don't ask me why, but the compiler doesn't
like property access on variables of type id). Changing the code to
message sending rather then property access should get rid of the
complaint at any rate:
CGPoint pt = [layer position];
or you can use a cast with the property access notation:
CGPoint pt = ((CALayer *)layer).position;
-António
-----------------------------------------
Accepting others as they are
brings a wonderful freedom
to your own mind.
--The Peace Formula
-----------------------------------------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden