这是我的代码:
float timeInterval = 1 / [frameRateTextField floatValue];
recordingTimer = [NSTimer scheduledTimerWithTimeInterval:timeInterval
target:self
selector:@selector(recordingTimerSelector:)
userInfo:nil
repeats:YES];
- (void) recordingTimerSelector:(NSTimer*)timer{
NSXMLElement *timecode = [[NSXMLElement alloc] initWithName:@"timecode"];
[timecode setStringValue:[NSString stringWithFormat:@"%@,%@,%@,%@,%@",[DMXChannelArray objectAtIndex:0], [DMXChannelArray objectAtIndex:1], [DMXChannelArray objectAtIndex:2], [DMXChannelArray objectAtIndex:3], [DMXChannelArray objectAtIndex:4]]];
[root addChild:timecode];
time = time + 1;
[theRecordingTime setStringValue:[NSString stringWithFormat:@"%d", time]];
}
这是最好的方法吗?我基本上是在制作分辨率为 30FPS 的“录像机”。有没有办法让它与实际时间一致,而不是成为一个单独的实体?它可能会使它更准确。喜欢:
10:40:41.0 - record element
10:40:41.3 - record element
10:40:41.6 - record element
谢谢!