您好,每次我尝试用 CFAbsoluteTimeGetCurrent() 记录日期时;我的应用程序忽略了其余的按钮,就好像它接管了所有内存并阻止了所有用户输入。我想知道我做错了什么?我想制作一个函数 showtime() 但我不知道如何在函数之间传递从 toggleRecording 到 showtime 的值,这样如果这甚至可以解决问题,我的方法就可以工作。下面是我的代码:
- (IBAction)toggleRecording:(id)sender
{
// Start recording if there isn't a recording running. Stop recording if there is.
[[self recordButton] setEnabled:NO];
if (![[[self captureManager] recorder] isRecording]){
[[self captureManager] startRecording];
/* figure out a day to record for every half a second
while([[[self captureManager]recorder] isRecording]){
CFTimeInterval startTime = CFAbsoluteTimeGetCurrent();
NSLog(@" time is %i", startTime);
}
*/
}
else
[[self captureManager] stopRecording];
}
-(void)showtime:(id)sender{
while([[[self captureManager]recorder] isRecording]){
CFTimeInterval startTime = CFAbsoluteTimeGetCurrent();
NSLog(@" time is %f", startTime);
}
}