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 03:02:06 +0100
El 9/11/2006, a las 21:42, j o a r escribió:
On 9 nov 2006, at 16.38, leenoori wrote:
Any one done this or have an idea of how to do it?
A very simple and safe way to do this would be to wrap NSTimer in a
custom class, where each object has an NSTimer object as an
instance variable. Then you just have to duplicate the parts of the
NSTimer interface that you need on your custom class, and forward
messages to your internal NSTimer object as appropriate.
Are you sure it would be simple? I thought about doing this and in
fact started working on it, but then I asked myself:
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.
_______________________________________________
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