Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTimer retains its target ???



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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.