• 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
Re: [self setLayer:] in initWithFrame:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [self setLayer:] in initWithFrame:


  • Subject: Re: [self setLayer:] in initWithFrame:
  • From: Bill Dudney <email@hidden>
  • Date: Thu, 21 Feb 2008 19:40:29 -0700

Hi Nathan,

If you move your layer code into awakeFromNib you should have much better results.

If you don't have layer backing turned on in the nib file the view loading machinery turns off layer backing after initWithFrame: is called.

HTH,


-bd- http://bill.dudney.net/roller/objc

On Feb 21, 2008, at 7:12 PM, Nathan Vander Wilt wrote:

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:
This email sent to email@hidden

_______________________________________________

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: [self setLayer:] in initWithFrame:
      • From: Nathan Vander Wilt <email@hidden>
References: 
 >[self setLayer:] in initWithFrame: (From: Nathan Vander Wilt <email@hidden>)

  • Prev by Date: NSURLConnection failing
  • Next by Date: Conditional slideback?
  • Previous by thread: [self setLayer:] in initWithFrame:
  • Next by thread: Re: [self setLayer:] in initWithFrame:
  • Index(es):
    • Date
    • Thread