Mailing Lists: Apple Mailing Lists

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

Re: [self setLayer:] in initWithFrame:



Hi Nate,

Glad it works!

You are correct that when you want to set up you own layer hierarchy its best to leave that for awakeFromNib instead of setting the check box. When you check that a view wants a layer in IB and then replace it its just wasting creating that layer and such. Also I have occasionally seen some strange behavior from views that had that checkbox turned on in IB after I replace it's layer. I think that when a view comes out of a nib thinking that its layer backed (instead of layer hosting) it makes some assumptions about what it can do with/to the layer that are not valid once you replace the layer.

So I have had better luck just leaving that checkbox unchecked in IB.

anyway sorry to ramble, good luck!


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

On Feb 21, 2008, at 9:11 PM, Nathan Vander Wilt wrote:

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.

Ah, that explains it!

From my understanding (and the docs don't elaborate on
this much at all), I *don't* want to do that, since I
need to provide my own layer before  calling
wantsLayer:, correct?

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
References: 
 >Re: [self setLayer:] in initWithFrame: (From: Nathan Vander Wilt <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.