• 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: Animated subviews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Animated subviews


  • Subject: Re: Animated subviews
  • From: David Duncan <email@hidden>
  • Date: Mon, 24 Nov 2008 09:39:50 -0800

On Nov 23, 2008, at 9:54 AM, DKJ wrote:

Now I'm getting a very odd result. In the code for a UIView I have this:

	CALayer *theLayer = self.layer;
	id pLayer = [theLayer presentationLayer];

The first line is fine, but for the second I get a compiler warning:

no '-presentationLayer' method found

Did you import the QuartzCore/QuartzCore.h header?

I'm looking at the CALayer docs, which has this:

	- (id)presentationLayer

	Return Value
	A layer instance representing the current presentation layer.

Any idea what's going on? (I'm also puzzled why this method would return an id.)


The return value is an id so that you can assign it to the proper real class without type casting. For example...

CALayer *pLayer = [myLayer presentationLayer];
CATiledLayer *ptLayer = [myTiledLayer presentationLayer];

If it was statically typed as a CALayer, then the second assignment would require a typecase.
--
David Duncan
Apple DTS Animation and Printing


_______________________________________________

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: 
 >Animated subviews (From: DKJ <email@hidden>)
 >Re: Animated subviews (From: Wyatt Webb <email@hidden>)
 >Re: Animated subviews (From: DKJ <email@hidden>)

  • Prev by Date: Re: Need some advice on multithreading
  • Next by Date: Re: Core Animation: How to swicth off all implicit animations?
  • Previous by thread: Re: Animated subviews
  • Next by thread: Automatic file numbering ideas...
  • Index(es):
    • Date
    • Thread