• 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
Intercepting retain/release of object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Intercepting retain/release of object


  • Subject: Intercepting retain/release of object
  • From: Stuart Malin <email@hidden>
  • Date: Wed, 19 Mar 2008 07:54:47 -1000

I am having some trouble in an app with an object and its retain counts, so I added methods to intercept -retain and -release on my affected object so I could set breakpoints to observe the value. But doing so causes some really odd behavior, such as the object receiving extra retain events (such as when it is _removed_ from an array). Why would my intercepting these, but nonetheless propagating them up the class hierarchy, cause problems?

- (void) retain
{
	[super retain];
	unsigned int count = [self retainCount];
	NSLog(@"RETAIN: retain count after retain is: %i", count);
}

- (void) release
{
	[super release];
	unsigned int count = [self retainCount];
	NSLog(@"RELEASE: retain count after release is: %i", count);
}





_______________________________________________

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: Intercepting retain/release of object
      • From: "Rob Napier" <email@hidden>
    • Re: Intercepting retain/release of object
      • From: Pierre Molinaro <email@hidden>
    • Re: Intercepting retain/release of object
      • From: Nick Zitzmann <email@hidden>
    • Re: Intercepting retain/release of object
      • From: "Jonathan del Strother" <email@hidden>
  • Prev by Date: Re: To get machine type (ppc, intel)
  • Next by Date: Re: Network communication with NSFileHandle & NSSocketPort
  • Previous by thread: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
  • Next by thread: Re: Intercepting retain/release of object
  • Index(es):
    • Date
    • Thread