これが私のコードです:
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
ありがとう!