开发者

iPhone Method Question

开发者 https://www.devze.com 2023-02-22 12:54 出处:网络
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

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

精彩评论

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

关注公众号