Re: Setting a layer delegate affects drawRect being called
Re: Setting a layer delegate affects drawRect being called
- Subject: Re: Setting a layer delegate affects drawRect being called
- From: David Duncan <email@hidden>
- Date: Thu, 16 Apr 2009 14:57:03 -0700
On Apr 16, 2009, at 2:54 PM, Mohan Parthasarathy wrote:
I have a View whose drawRect method never gets called when I call
[View
setNeedsDisplay]. It looks like the reason is that the View's layer
delegate
is been set and If I remove that drawRect is called. Is this an
expected
behavior or something else is going on ?
Yes, it is expected behavior and documented in the UIView
documentation at <http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html
>.
Specifically under the documentation for the layer property:
"Since the view is the layer’s delegate, you should never set the view
as a delegate of another CALayer object. Additionally, you should
never change the delegate of this layer."
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
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