开发者

iPhone Method Question

I have a method that will analyze if a sound is above a certain decibel level, and if it is then do an action. I currently am currently calling this method as such

- (void) listen { .... }

The problem is that, I want the program to constantly be l开发者_如何学编程isten for noise, if the user choses to, not just when I call the method. Should I just hide a button in the background, and just leave it on, or is there an easier and more efficient way to do this.


You could always initialize a NSTimer to constantly trigger that check for you...

The timerWithTimeInterval:invocation:repeats: method allows you to run it constantly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜