• 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
Unwanted retain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unwanted retain


  • Subject: Unwanted retain
  • From: Lorenzo <email@hidden>
  • Date: Wed, 04 Feb 2004 23:41:23 +0100

Hi,
I noted that when I call scheduledTimerWithTimeInterval, my self object
retainCounter increments by one.
-------
NSLog(@"A self retain count %d", [self retainCount]);
renderTimer = [[NSTimer scheduledTimerWithTimeInterval:timeInterval
target:self selector:@selector(fireTheTimer) userInfo:nil
repeats:YES] retain];
NSLog(@"B self retain count %d", [self retainCount]);
-------

I get:
-------
A self retain count 1
B self retain count 2
-------



Then if I deallocate one time only the object "self" from the class I
created it, I don't see the object self deallocated. I have to deallocate it
twice, but then my app crashes.

Why? Do you know how to fix this?

Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Unwanted retain
      • From: Kyle Moffett <email@hidden>
    • Re: Unwanted retain
      • From: Jörn Salewski <email@hidden>
    • Re: Unwanted retain
      • From: Finlay Dobbie <email@hidden>
    • RE: Unwanted retain
      • From: "Jonathan E. Jackel" <email@hidden>
    • Re: Unwanted retain
      • From: "b.bum" <email@hidden>
    • Re: Unwanted retain
      • From: Chris Parker <email@hidden>
    • Re: Unwanted retain
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: AppleEvents in a Java tool
  • Next by Date: Re: Cocoa/Windows parallel dvlpmt
  • Previous by thread: AppleEvents in a Java tool
  • Next by thread: Re: Unwanted retain
  • Index(es):
    • Date
    • Thread