2016-08-09 2 views
2

나는이아이폰 OS는 상태

dispatch_queue_t myBackgroundQueue; 
    myBackgroundQueue = dispatch_queue_create("com.google.task", NULL); 


    dispatch_async(myBackgroundQueue, ^(void) { 
    }); 

이 버튼을 클릭 호출되고 난 현재 배경 실행 큐를 알고 싶습니다처럼 큐를 만들었을 완료했다. 감사합니다.

+0

'현재 백그라운드 실행 대기열을 알고 싶습니다.'라는 것이 무슨 의미인가요? 결과에서 기대하는 바를 설명해 주시겠습니까? – Konstantin

+0

@ Constantin : 예 현재 실행중인/대기중인 총 백그라운드 대기열을 알고 싶습니다. –

+0

대기열이 하나뿐이므로 대기열에 포함 된 작업 수를 알아야합니까? – Konstantin

답변

0
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 
    BOOL ok = // some result 

    // do some long running processing here 

    // Check that there was not a nil handler passed. 
    if(completionHandler) 
    { 
     // This assumes ARC. If no ARC, copy and autorelease the Block. 
     [completionHandler performSelector:@selector(rmaddy_callBlockWithBOOL:) 
            onThread:origThread 
           withObject:@(ok) // or [NSNumber numberWithBool:ok] 
          waitUntilDone:NO]; 
    } 
    }); 
});