I'm close to meeting my first iPhone app and it's a pleasure to use a current time using a nestimer's I am trying to add the time from the current time (NSDT) to the time of running on UILB. NSDT is working fine for me, showing hours, minutes, seconds, milliseconds but instead of milliseconds, I need to show 24 frames per second.
The problem is that I want to have hours, minutes and Frames per second are required to synchronize with 100% second, so I can not add frames to a different timer. I tried to do it and it was working, but the frame timer was not running in synchronization with the date timer.
Can anyone help me with it? Is there a way to optimize NSDateFormatter so that I have a formatted date timer with 24 frames per second? Right now I am limited to the formatting of hours, minutes, seconds and milliseconds.
Here is the code that I am currently using
- (zero) runTimer {// it starts the timer that displays the display. Calculation method runs every 0.01 seconds timer = [NSTimer Scheduled timer with intermediate interrerel: .01 target: self selector: @sillector (display) user information: zero repeats: yes]; } // This sets the text on the ULABLLES by using the current date of the timer - (zero) display; {NSDateFormatter * formatter = [[NSDateFormatter alloc] init] autorelease]; NSDT * date = [NSDT date]; // It will produce a time that looks like "12: 15: 07: 75" using 4 different labels / I can take it only on one label, but now they are separated / / This hour sets the label and formats it in [formatter setDateFormat: @ "hh"]; [TimecodeHall label set text: [Former string format: date]]; // This minute sets the label and forms it in minutes [format setDateFormat: @ "mm"]; [TimecodeManuteLabel Settext: [Former StringFormat: date]]; // it sets the second label and it formats it in seconds [format setDateFormat: @ "ss"]; [Timecodesecondellabel settext: [complete string format: date]]; // This frame sets the label and forms it in millisecond / I need 24 seconds per second [formatter setDateFormat: @ "SS"]; [Timecode FrameLabel Settap: [Former StringFormat: Date]]; } "post-text" itemprop = "text"> I can suggest that you can remove the milliseconds from your NSDate
code> - in seconds , So the numeric value will give you milliseconds. Then using the NSString
method by using a plain format string, stringvatformat
:.
Comments
Post a Comment