Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chirone

macrumors 6502
Original poster
Mar 2, 2009
279
0
NZ
hi all,
the CALayers aren't displaying in my code like they do in the sample code

the only way i can get a quicktime layer to show up on an NSView is if i copy and past the NSView from a working example and paste it into my code
the strange thing is, is that i don't understand what's different between the NSView that will display the layer and the brand new one pulled out from IB
the inspector shows no difference at all, and yet they are both different. what gives?

also, there seems to be only one way to get a layer to even show up.
Code:
compositionView.layer = mMovieLayer;
where mMovieLayer is a QTMovieLayer* and compositionView is a IBOutlet NSView*

Code:
[rootLayer addSublayer: exampleQTMovieLayer];
	compositionView.layer = rootLayer;
where rootLayer is a CALayer and exampleQTMovieLayer is a QTMovieLayer
this code shows up with nothing...
i even put in the code
Code:
[compositionView setWantsLayer: YES];
thinking it would help... but nothing...

I thought if i could build up the sublayers and put drawings on the QT clip then it would work, and i could just export out a QT like i saw in someone elses example code.

but as soon as i use sublayer nothing shows up...
it works in everyone elses code... i can't see what i'm doing wrong...


i do get a warning when i compile about the rootLayer though
warning: local declaration of 'rootLayer' hides instance variable
;
caused by these lines here:
Code:
CALayer* rootLayer = [[CALayer alloc] init];
    compositionView.layer = rootLayer;
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.