How to Find All CALayers assoicated with an nsview?
I'm hosting Apple's Pitch Shift Audio Unit plugin in Mac OSX 10.7 Lion. The pitchShiftView is made up of CALayers: one for eac开发者_高级运维h knob etc.
There are value bars that appear when changing parameter values with the knobs that I believe are CALayers, but they do not show up in the CALayer hierarchy. They stay on screen when they should disappear, and end up crashing my app with exit bad access.
How do I gain access to these layers, or why arn't they tied to the rest of the layer hierarchy?
They may not actually be layers, or at least not layers in the current NSView
. They might be subviews of the NSView, or they might even be NSViews that hover over top of the NSView in question. Almost anything is possible.
The first tool you want is Accessibility Inspector (in /Developer). It lets you point at anything on the screen and find out where it is in the accessibility hierarchy, which very often is closely related to where it is in the view hierarchy. Once you understand where they are in the view hierarchy, you can start digging around with the debugger trying to understand where they are in the layer hierarchy, if they're in the layer hierarchy. Remember that on Mac, CALayer
is an optional addition to NSView
. So there might not be layers.
精彩评论