• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accessing CALayer properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Accessing CALayer properties (From: Jesus De Meyer <email@hidden>)

  • Prev by Date: Accessing CALayer properties
  • Next by Date: Re: Accessing CALayer properties
  • Previous by thread: Accessing CALayer properties
  • Next by thread: Re: Accessing CALayer properties
  • Index(es):
    • Date
    • Thread