• 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
Re: Creating an NSTimer subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Creating an NSTimer subclass
      • From: j o a r <email@hidden>
References: 
 >Creating an NSTimer subclass (From: leenoori <email@hidden>)
 >Re: Creating an NSTimer subclass (From: j o a r <email@hidden>)
 >Re: Creating an NSTimer subclass (From: leenoori <email@hidden>)
 >Re: Creating an NSTimer subclass (From: j o a r <email@hidden>)

  • Prev by Date: Re: OT: Where do the UI designers live?
  • Next by Date: XML to NSDictionary
  • Previous by thread: Re: Creating an NSTimer subclass
  • Next by thread: Re: Creating an NSTimer subclass
  • Index(es):
    • Date
    • Thread