‽
|
So, I've been writing a little app that periodically checks the CPU temperature and displays it in the menu bar. Now I'd like the user to be able to change the interval (frequency) of the gauging. I'm using NSTimer's scheduledTimerWithTimeInterval; however, it appears there is no way to change the interval later on. I figure I'm supposed to invalidate the timer and create a new one, but I'm currently at a loss regarding implementing that. Namely, it seems that the old timer doesn't immediately destroy itself, so for a short time, I have two timers running, which is definitely not what I want.
I would much prefer being able to change the original timer's interval instead, rather than having to create multiple ones. I haven't found much documentation on this, surprisingly, so I'm wondering if anyone has experience. |
quote |
‽
|
No ideas?
|
quote |
‽
|
Figured it out (by releasing and reallocating). Not necessarily happy with this solution, but whatever.
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Quote:
(Yes, I agree it's not very elegant either.) |
|
quote |
‽
|
Quote:
|
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |