이 문제를 해결하는 방법은 먼저 UIApplication을 서브 클래스 화하고 setIdleTimerDisabled 메서드를 재정의하여 아무 것도하지 않게하는 것입니다. 그런 다음 일반 설정기를 사용하는 대신 응용 프로그램에서 호출 할 몇 가지 메서드를 추가하십시오. 이렇게하면 유휴 타이머를 변경할 수있는 모든 메시지는 사용자가 직접 지정한 사용자 지정 메서드 호출을 무시한 채 무시됩니다. 여기 당신이 그것을 할 방법 :
편집 사용자 정의 UIApplication 서브 클래스 사용하도록 main.m 파일 :
@interface CustomUIApplicationSubclass : UIApplication {
}
- (void)disableIdleTimer;
- (void)enableIdleTimer;
@end
@implementation CustomUIApplicationSubclass
- (void)setIdleTimerDisabled:(BOOL)disabled
{
// do nothing! take that stupid ipod controller!
}
- (void)enableIdleTimer
{
[super setIdleTimerDisabled:NO];
}
- (void)disableIdleTimer
{
[super setIdleTimerDisabled:YES];
}
@end
이에 아이팟 컨트롤러를 강제로 : 그런 다음 UIApplication 하위 클래스를 정의
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* appClass = @"CustomUIApplicationSubclass";
NSString* delegateClass = nil;
int retVal = UIApplicationMain(argc, argv, appClass, delegateClass);
[pool release];
return retVal;
}
을 일반적인 setIdleTimerDisabled 메서드가 호출 될 때 더 이상 아무것도 수행하지 않는 사용자 지정 UIApplication 인스턴스를 사용하십시오.
동일한 문제가 있습니다. 나 한테 버그 같아. – NeilInglis