NSTimer and call-by-reference
NSTimer and call-by-reference
- Subject: NSTimer and call-by-reference
- From: Colin Jackson <email@hidden>
- Date: Thu, 13 Feb 2003 12:44:33 +0000
I have a method with the following signature:
- (void) timerForController:(NSString *)controller type:(NSString
*)type target:(id)target selector:(SEL)aSelector
repeats:(BOOL)doesRepeat timer:(NSTimer *)timer
For some reason, whenever I call this method, whatever timer is passed
gets duplicated. ie, the method checks that the timer valid and is
still doing the right thing according to current circumstances (I won't
bore you with them), then recreates the timer if it is not.
When I check if the timer is valid, it always returns no. Then it
creates a new timer so I get lots of events firing. It looks like the
NSTimer isn't being called-by-reference properly.
By the way, this works when I use the same code directly (instead of
inside a method). Its just that I need to have 8 timers which do
pretty much the same thing so I don't want to have to inline code for
each of them.
Thanks,
Colin
_______________________________________________
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.