Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想让 iPhone 振动,我找到了代码
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
但是 Xcode 4.3.2 报告错误:未声明的标识符 kSystemSoundID_Vibrate
有什么问题?
尝试:
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
编辑:还要确保你导入AudioToolbox.framework
AudioToolbox.framework
#import <AudioToolbox/AudioToolbox.h>