Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[self setLayer:] in initWithFrame:



I provide an initWithFrame: for my NSView subclass,
and as it is a stand-in for a Custom View in IB the
method is called. It does initialize all my instance
variables as expected.

However, when I try to turn my view into a
layer-hosting view with:
	CALayer* rootLayer = [CALayer layer];
	[self setLayer:rootLayer];
	[self setWantsLayer:YES];
	[rootLayer setDelegate:self];
	[rootLayer setNeedsDisplay];

My delegate method is never called, nor are any
borders shown if I set those properties on my
rootLayer. (The delegate does get a look, though,
since I can crash the app by feeding a garbage pointer
as a delegate.) Moving this code into my view's
awakeFromNib handler makes the delegate work as
expected.

Why can't I enable layer hosting in my initWithFrame:
method?


thanks,
-natevw


      ____________________________________________________________________________________
¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:                      
http://correo.espanol.yahoo.com/
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.