Possible Duplicate:
Making the iPhone vibrate
How can yo开发者_C百科u programmatically make the iPhone vibrate?
Any ideas, or tutorial links appreciated.
You can use
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
Note that you need to add the AudioToolbox framework and import the following header file:
#import <AudioToolbox/AudioServices.h>
To clarify the add(ing) the AudioToolbox framework portion of this answer:
- click the project from Project Navigator
- click the target from the left-hand navigator
- click Build Phases section at the top
- expand the Link Binary With Libraries section
- click little + (plus) sign
- type
AudioToolbox.framework
- click Add
精彩评论