• 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: Setting a layer delegate affects drawRect being called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Setting a layer delegate affects drawRect being called (From: Mohan Parthasarathy <email@hidden>)

  • Prev by Date: Setting a layer delegate affects drawRect being called
  • Next by Date: Create folder in protected directory
  • Previous by thread: Setting a layer delegate affects drawRect being called
  • Next by thread: Re: Setting a layer delegate affects drawRect being called
  • Index(es):
    • Date
    • Thread