2012-01-11 1 views
0

다행히 간단한 질문이지만 iOS3/device 멀티 태스킹이 지원되지 않습니다.iOS 멀티 태스킹이 지원되지 않습니다.

내 앱이 백그라운드에서 실행되도록 설정되었습니다 (오디오 재생). 실행되는 애니메이션이 있으며 applicationDidEnterBackground를 통해 종료됩니다.

멀티 태스킹이 지원되지 않는 경우 앱을 종료하고 싶습니다.

UIDevice* device = [UIDevice currentDevice]; 
BOOL backgroundSupported = NO; 
if ([device respondsToSelector:@selector(isMultitaskingSupported)]) 
    backgroundSupported = device.multitaskingSupported; 

if (backgroundSupported == NO) { 
    NSLog(@"Multitasking not supported"); 
} 
else 
{ 
    NSLog(@"Multitasking supported"); 
} 

내 질문은 .... 어떻게 위의 else 문 내부에서 응용 프로그램을 죽일 수있다 : 나는 장소에 코드는 멀티 태스킹 기능을 감지 할 수있다?

감사

답변

2

다음은 작동합니다 : 종료 (0)

이것은 또한, [[NSThread mainThread] 출구] 가능하며,이 아마 이렇게하는 더 좋은 방법입니다, Objective- 함께있어 너도 내 친구가 될 수있어.

+0

감사합니다. Daniel. [[NSThread mainThread] exit]를 사용합니다. – Tony

관련 문제