• 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: CALayer subclass allocation problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer subclass allocation problem


  • Subject: Re: CALayer subclass allocation problem
  • From: Kyle Sluder <email@hidden>
  • Date: Tue, 10 Nov 2009 13:30:08 -0800

On Nov 10, 2009, at 12:57 PM, Bob Barnes <email@hidden> wrote:

hi all,

My iPhone app has 2 subclasses of CALayer that appear as leaked objects when I run Instruments. In an effort to understand why I inserted calls to retainCount when allocating these objects. After calling alloc the reference count on my objects is 0, but after calling the init method, which basically just calls [super init], the reference count is 2. Is there something peculiar about CALayer that would explain this behavior?

Don't look at retainCount. There's no reason it couldn't be any number greater than 0 at any time. It will not help you debug your app.


Run the static analyzer on your code, use Instruments to track retains and releases, and use the debugger, not NSLog, as your debugging tool of choice.

--Kyle Sluder
_______________________________________________

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: CALayer subclass allocation problem
      • From: Bob Barnes <email@hidden>
References: 
 >CALayer subclass allocation problem (From: Bob Barnes <email@hidden>)

  • Prev by Date: 10.6.2 Core Data Incompatibility
  • Next by Date: questions on memory issues
  • Previous by thread: CALayer subclass allocation problem
  • Next by thread: Re: CALayer subclass allocation problem
  • Index(es):
    • Date
    • Thread