Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 使用shake API检测震动_Objective C_Ios5_Ios4_Xcode4_Motion Detection - Fatal编程技术网

Objective c 使用shake API检测震动

Objective c 使用shake API检测震动,objective-c,ios5,ios4,xcode4,motion-detection,Objective C,Ios5,Ios4,Xcode4,Motion Detection,用于监控震动的motionstart:或motionend:等事件只有在我的视图中有第一响应者时才能触发。好的,我可以这样设置视图第一响应者:[self.view becomeFirstResponder]。但是视图在默认情况下不能是第一个响应者(为什么?),因此我需要创建一个UIView子类,并覆盖默认的canBecomeFirstResponder到YES。这个UIView子类到底有什么帮助?这一切是如何运作的?请帮助。查看本指南,特别是关于急救人员的内容:

用于监控震动的
motionstart:
motionend:
等事件只有在我的视图中有第一响应者时才能触发。好的,我可以这样设置视图第一响应者:
[self.view becomeFirstResponder]。但是视图在默认情况下不能是第一个响应者(为什么?),因此我需要创建一个UIView子类,并覆盖默认的
canBecomeFirstResponder
YES
。这个UIView子类到底有什么帮助?这一切是如何运作的?请帮助。

查看本指南,特别是关于急救人员的内容: