from: http://stackoverflow.com/a/4725039

There are two seemingly similar functions that take a parameter kSystemSoundID_Vibrate:

)AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
)AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Both the functions vibrate the iPhone. But when you use the first function on devices that don’t support vibration, it plays a beep sound. The second function on the other hand does nothing on unsupported devices. So if you are going to vibrate the device continuously, as a alert, common sense says, use function 2.

See also "iPhone Tutorial: Better way to check capabilities of iOS devices" article.

First, add the AudioToolbox framework (AudioToolbox.framework) to your target in Build Phases.

Then, header file to import:

#import <AudioToolbox/AudioServices.h>

Making the iPhone vibrate (iPhone 振动)的更多相关文章

  1. [转]在cocos2d-x中让一个项目适配iphone、iphone retina、ipad、ipad retina四种分辨率

    http://cankeyyin.blog.163.com/blog/static/12336178320124149391202/ 原理:将iphone的hd图片给ipad用,即: 使用原iphon ...

  2. iPhone 6/iPhone 6 Plus硬件性能

    iPhone 6/iPhone 6 Plus硬件性能 评分 4 分 正 如之前传闻的,这次同时发布了两款iPhone产品,分别是4.7英寸的iPhone 6和5.5英寸的iPhone 6 Plus.苹 ...

  3. iPhone 6 & iPhone 6 Plus适配

    转载请注明出处: http://www.cnblogs.com/dokaygang128/p/4049461.html Apple 今年发布了两款新的iPhone机器,iPhone 6 和iPhone ...

  4. iOS屏幕适配 支持新手机 iPhone XR iPhone XS 超简单

    随着苹果爸爸发布了 超牛叉的iPhone iPhone X .iPhone XR.iPhone XS .iPhone XS Max.开发者的适配工作要开始了. 停,

  5. iPhone: 在 iPhone app 里使用 UIPopoverController

    更新:iOS8 版本已经不可用 为 UIPopoverController 增加类别,如下: //NSObject+UIPopover_Iphone.h #import <Foundation/ ...

  6. iPhone 6 Screen Size and Web Design Tips

    Apple updated its iPhone a bit ago making the form factor much bigger. The iPhone 6 screen size is b ...

  7. 苹果官方发布,iPhone 6 & Plus 设计素材

    苹果发布 iPhone 6 和 iPhone 6 Plus 有一段时间了,据说首日预定量达到了创纪录的1600万部,真是不可思议.苹果已经创建了一些指引,让开发者可以受益.他们已经发布了一组苹果官方的 ...

  8. 大屏iPhone的适配 +iOS 图片尺寸要求

    摘自:http://blog.ibireme.com/2014/09/16/adapted_to_iphone6/ 苹果公司官网设计介绍到:Retina显示屏的超高像素密度已超过人眼能分辨的范围.Re ...

  9. App如何适应 iPhone 5s/6/6 Plus 三种屏幕的尺寸?

    来自//www.cocoachina.com/ 初代 iPhone 2007 年,初代 iPhone 发布,屏幕的宽高是 320 x 480 像素.下文也是按照宽度,高度的顺序排列.这个分辨率一直到 ...

随机推荐

  1. Android:EditText 属性

    Android开发EditText属性 EditText 官网链接 EditText继承关系:View-->TextView-->EditText EditText 部分属性: XML 设 ...

  2. vim-snipmate的c.snippets(2016.7.10)

    ## Main # main snippet main int main ( void ) { ${} ; } ##include snippet inc #include <${:stdio} ...

  3. ajaxfileupload异步上传附件添加參数的方法

    1.js文件 // JavaScript Document jQuery.extend({ createUploadIframe: function(id, uri) { //create frame ...

  4. jquery input切换编辑和不可编辑模式,input自动获得焦点,遍历所有的子类标签

    input切换编辑和不可编辑模式 在项目中我们经常会用到这样的效果,点击一下不可编辑的input 标签,变成可编辑的input标签.用法如下 <input type="text&quo ...

  5. UML笔记1

    UML包括 事物 结构:类,接口等等 行为:交互,状态改变等 分组:包,子系统等 注释 关系 依赖,关联(聚合,组合),泛化,实现 图 用例图,交互图(顺序图,协作图),类图,活动图,状态图等 扩展机 ...

  6. android 使用 sqlite

    SQLiteHelper .class  (升级的时候,做点小技巧) package com.keyue.qlm.util;  import android.content.Context;  imp ...

  7. 利用IT++搭建通信仿真平台

    IT++ is a C++ library of mathematical, signal processing and communication classes and functions.也就是 ...

  8. 使用 LocalReport 对象进行打印

    添加引用   从“项目”菜单中,选择“添加引用”.将显示“添加引用”对话框. 从“.NET”选项卡上显示的列表框中,选择 Winforms 和 Drawing 组件. 添加代码 应打开 Program ...

  9. posix进程间通信

    ************************************************************************************************** p ...

  10. linux/unix 段错误捕获_转

    转自:linux/unix 段错误捕获[续] 本文为“在C/C++中捕获段错误,打印出错的具体位置”的续篇,进一步解决涉及动态链接库的情况.   背景知识: ·linux/unix下动态链接库的基本原 ...