开发者

IPhone SDK - Vibration triggered by Thread

I'm currently working on an IPhone App that should make the phone vibrate if a special event occurs.

The checks to trigger the alert is done in a thread.

Unfortunately the phone won't vibrate if I call

 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);开发者_运维问答

from inside the thread. (It works fine if I call this in my "viewDidAppear" method).

I even tried to do a callback from inside the thead like this:

 inside Thread:
 [self performSelectorOnMainThread:@selector(doAlarm) 
                                               withObject:nil 
                                            waitUntilDone:true];    

 -(void)doAlarm {
   AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);            
 }

which has the same result: No vibration on the phone.

How do I make the phone vibrate from inside a thread ??

Thanks in advance


Got it !

There were a Microphone Listener active which caused the problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜