Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
A couple xCode questions
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="SoulRed12" data-source="post: 1036213" data-attributes="member: 146412"><p>Hey.</p><p></p><p>I'm new to xCode but learning fast due to already having somewhat of a background in C++.</p><p>The whole square bracket/message thing was a little disconcerting at first, but I got used to it.</p><p></p><p>Anyways, on to my questions. There's two of them.</p><p></p><p>One:</p><p></p><p>I'm writing a little practice app for Mac osx that's supposed to allow you to set a timer and</p><p>then show a reminder message when the time runs out:</p><p></p><p><a href="http://img265.imageshack.us/i/picture2ki.png/" target="_blank"><img src="http://img265.imageshack.us/img265/7140/picture2ki.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></a></p><p></p><p>The slider is used to select # of minutes to set, the level indicator drains as time runs out, and the label</p><p>that says "1" changes to show number of minutes selected on the slider (not time remaining). Right now I'm</p><p>using a repeating NSTimer to tick seconds down. However, when the computer goes to sleep,</p><p>the NSTimer obviously stops repeating until the computer awakens.</p><p></p><p>I figure I need an NSDate set to x amount of seconds in the future (using dateWithTimeIntervalSinceNow)</p><p>but being that the user can press start and stop whenever they want, however many times they want,</p><p>they're going to be creating many NSDate's. When creating a new NSDate, do I just release the old one</p><p>by calling [endTime release] and then calling the above method again to create the next timer?</p><p>(assuming of course I already have an NSDate object named endTime)</p><p></p><p>Two:</p><p></p><p>I original wanted my slider on the above program to go from 1-240, and multiply the amount chosen</p><p>by 0.25 thus allowing them to choose from 1-60 minutes in 15 second increments. But as mentioned,</p><p>I also have a label on which I'm displaying the value of the slider.</p><p></p><p>I got the takeIntValueFrom thing down (by that I mean I control+clicked and dragged from the slider</p><p>to the textbox, and chose that method), but if the slider is 1-240, the label can also show 1 to 240.</p><p>How can I get it to multiply the slider value by 0.25 and show THAT on the label in real time</p><p>(thus still only showing 1-60?</p></blockquote><p></p>
[QUOTE="SoulRed12, post: 1036213, member: 146412"] 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: [URL=http://img265.imageshack.us/i/picture2ki.png/][IMG]http://img265.imageshack.us/img265/7140/picture2ki.png[/IMG][/URL] 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? [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
A couple xCode questions
Top