Re: Creating an NSTimer subclass
Re: Creating an NSTimer subclass
- Subject: Re: Creating an NSTimer subclass
- From: leenoori <email@hidden>
- Date: Fri, 10 Nov 2006 12:13:55 +0100
El 10/11/2006, a las 8:03, j o a r escribió:
On 10 nov 2006, at 03.02, leenoori wrote:
How would you schedule such a timer, given that the method for
doing so is actually in NSRunLoop (addTimer:forMode:)? What
happens when you pass such a subclass to addTimer:forMode:? Class-
dump shows no instance variables on NSTimer or its subclasses, nor
any methods which look like candidates for use in adding a timer
to a run loop.
You would schedule the wrapped timer object, and not your object
instance.
Unfortunately then it's not longer a drop-in NSTimer replacement, but
would need some special way of being scheduled... eg a method on the
timer subclass itself like "schedule:forMode:" or whatever.
Although this would work, it would defeat the purpose for me, which
in this case is to have a drop-in replacement for NSTimer.
All I want is to add a couple of methods, and given that I need to
add a couple of instance variables as well, I can't just use a
category. So that leads me down this ugly path in which the subclass
doesn't behave like the real thing... :-(
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden