• 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
NSTimer retains its target ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTimer retains its target ???


  • Subject: NSTimer retains its target ???
  • From: Tobias Hermann <email@hidden>
  • Date: Tue, 29 Apr 2003 11:21:44 +0200

Hi!

I am having trouble with NSTimer... it seems that an NSTimer created with

[NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(timerAction:) userInfo: nil repeats: YES];

retains the passed target, which is self here.
That is really strange, because I thought TARGETS simply are references! And the target I pass here is the creator of the Timer, so it also makes no sense that the Timer retains its parent ?!

Problem is that I want to invalidate the timer within the dealloc method of the target. But that now never gets called because the timer retained it :-(

Is that a bug or am I misunderstanding something ?

thanx in advance

Tobi
_______________________________________________
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: NSTimer retains its target ???
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Tab-stop filled with dots?
  • Next by Date: Re: NSTimer retains its target ???
  • Previous by thread: Re: Adding an icon to an application folder
  • Next by thread: Re: NSTimer retains its target ???
  • Index(es):
    • Date
    • Thread