I just want to set the timer for the recorded voice. So, that it comes like an alarm after that time.(just like notifications). Is that possible.. Any help will be greatly appreciated...
我只想为录制的声音设置定时器。所以,它就像那段时间后的警报一样。(就像通知一样)。这可能..任何帮助将不胜感激......
Thanks in Advance
提前致谢
2 个解决方案
#1
3
Try reading NSTimer Class in developer documentation or you can refer this link
尝试在开发人员文档中阅读NSTimer类,或者您可以参考此链接
#2
3
You might want to look at local notifications and NSTimer
. Note that NSTimer
doesn't work when the app is in the background.
您可能希望查看本地通知和NSTimer。请注意,当应用程序在后台时,NSTimer不起作用。
Here is an example with NSTimer
:
以下是NSTimer的示例:
- (void)bar {
[NSTimer scheduledTimerWithTimeInterval:200.0f
target:self
selector:@selector(foo:)
userInfo:nil
repeats:YES];
}
- (void)foo:(NSTimer *)timer {
// Show alert or play recorded sound…
}
I'm afraid you can't play the recorded sound with local notifications, only when the app is in the foreground.
我担心只有在应用程序位于前台时,您才能使用本地通知播放录制的声音。
#1
3
Try reading NSTimer Class in developer documentation or you can refer this link
尝试在开发人员文档中阅读NSTimer类,或者您可以参考此链接
#2
3
You might want to look at local notifications and NSTimer
. Note that NSTimer
doesn't work when the app is in the background.
您可能希望查看本地通知和NSTimer。请注意,当应用程序在后台时,NSTimer不起作用。
Here is an example with NSTimer
:
以下是NSTimer的示例:
- (void)bar {
[NSTimer scheduledTimerWithTimeInterval:200.0f
target:self
selector:@selector(foo:)
userInfo:nil
repeats:YES];
}
- (void)foo:(NSTimer *)timer {
// Show alert or play recorded sound…
}
I'm afraid you can't play the recorded sound with local notifications, only when the app is in the foreground.
我担心只有在应用程序位于前台时,您才能使用本地通知播放录制的声音。