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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to