【发布时间】:2011-07-17 14:14:51
【问题描述】:
在 loadView 中,我将自己添加为观察者
[nc addObserver:self
selector:@selector(proximityAlert:)
name:UIDeviceProximityStateDidChangeNotification
object:device];
然后我告诉设备开始生成这些警报
[device setProximityMonitoringEnabled:YES];
我会处理它们
-(void)proximityAlert:(NSNotification *)note
问题是当我覆盖传感器太久时,屏幕会关闭,这对我的应用来说并不方便。
提前感谢所有答案。
【问题讨论】:
标签: iphone cocoa-touch ios4