• 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
LightTable Sample CoreAnimation Code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LightTable Sample CoreAnimation Code


  • Subject: LightTable Sample CoreAnimation Code
  • From: Alexander Heinz <email@hidden>
  • Date: Wed, 23 Jun 2010 22:09:18 -0400

Hello all,

I've been attempting to make sense of Apple's "LightTable" sample code for Core Animation, and I'm completely lost. Specifically, a couple of calls appear to be assigning an NSImage to the contents of a CALayer, which, as I previously understood, (and according to the documentation) should be impossible.

Specifically, the "LTView" class contains the following, in its -insertSlides:atIndexes: method:

	NSImage *image = [[NSImage alloc] initWithData:[slide valueForKey:kLTViewSlidePropertyPhoto]];
	(snip)
	LTMaskLayer *slideLayer = [LTMaskLayer layer];
	slideLayer.photo = image;

Jumping over to the "LTMaskLayer" class, (keeping in mind that _visiblePhoto is a plain-vanilla CALayer ivar) we have:

- (void)setPhoto:(id)newContents
{
	_visiblePhoto.contents = newContents;
}

Am I crazy? Aren't these calls assigning an NSImage to a CALayer's contents?

For reference, documentation for CALayer -setContents: reads:

A layer can set this property to a CGImageRef to display the image as its contents.

Can anyone explain what this code is doing?

Thanks in advance,
- Alex_______________________________________________

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

  • Follow-Ups:
    • Re: LightTable Sample CoreAnimation Code
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: checking if an app installed
  • Next by Date: Re: LightTable Sample CoreAnimation Code
  • Previous by thread: Re: How to debug: "Save partially failed: Error saving the persistent store."
  • Next by thread: Re: LightTable Sample CoreAnimation Code
  • Index(es):
    • Date
    • Thread