Hey.
I'm new to xCode but learning fast due to already having somewhat of a background in C++.
The whole square bracket/message thing was a little disconcerting at first, but I got used to it.
Anyways, on to my questions. There's two of them.
One:
I'm writing a little practice app for Mac osx that's supposed to allow you to set a timer and
then show a reminder message when the time runs out:
The slider is used to select # of minutes to set, the level indicator drains as time runs out, and the label
that says "1" changes to show number of minutes selected on the slider (not time remaining). Right now I'm
using a repeating NSTimer to tick seconds down. However, when the computer goes to sleep,
the NSTimer obviously stops repeating until the computer awakens.
I figure I need an NSDate set to x amount of seconds in the future (using dateWithTimeIntervalSinceNow)
but being that the user can press start and stop whenever they want, however many times they want,
they're going to be creating many NSDate's. When creating a new NSDate, do I just release the old one
by calling [endTime release] and then calling the above method again to create the next timer?
(assuming of course I already have an NSDate object named endTime)
Two:
I original wanted my slider on the above program to go from 1-240, and multiply the amount chosen
by 0.25 thus allowing them to choose from 1-60 minutes in 15 second increments. But as mentioned,
I also have a label on which I'm displaying the value of the slider.
I got the takeIntValueFrom thing down (by that I mean I control+clicked and dragged from the slider
to the textbox, and chose that method), but if the slider is 1-240, the label can also show 1 to 240.
How can I get it to multiply the slider value by 0.25 and show THAT on the label in real time
(thus still only showing 1-60?
I'm new to xCode but learning fast due to already having somewhat of a background in C++.
The whole square bracket/message thing was a little disconcerting at first, but I got used to it.
Anyways, on to my questions. There's two of them.
One:
I'm writing a little practice app for Mac osx that's supposed to allow you to set a timer and
then show a reminder message when the time runs out:
The slider is used to select # of minutes to set, the level indicator drains as time runs out, and the label
that says "1" changes to show number of minutes selected on the slider (not time remaining). Right now I'm
using a repeating NSTimer to tick seconds down. However, when the computer goes to sleep,
the NSTimer obviously stops repeating until the computer awakens.
I figure I need an NSDate set to x amount of seconds in the future (using dateWithTimeIntervalSinceNow)
but being that the user can press start and stop whenever they want, however many times they want,
they're going to be creating many NSDate's. When creating a new NSDate, do I just release the old one
by calling [endTime release] and then calling the above method again to create the next timer?
(assuming of course I already have an NSDate object named endTime)
Two:
I original wanted my slider on the above program to go from 1-240, and multiply the amount chosen
by 0.25 thus allowing them to choose from 1-60 minutes in 15 second increments. But as mentioned,
I also have a label on which I'm displaying the value of the slider.
I got the takeIntValueFrom thing down (by that I mean I control+clicked and dragged from the slider
to the textbox, and chose that method), but if the slider is 1-240, the label can also show 1 to 240.
How can I get it to multiply the slider value by 0.25 and show THAT on the label in real time
(thus still only showing 1-60?