2011-05-09 4 views
0

UITabBarcontroller에 4 개의 탭이 있습니다. 내 문제는 첫 번째 탭 프로세스가 진행되는 동안 사용자가 클릭하여 다음 탭으로 이동해야합니까 ?? 백그라운드에서 프로세스를 실행하는 방법 ??첫 번째 탭보기가 진행되는 동안 다음 탭을 탐색하는 방법은 무엇입니까?

첫 번째 탭보기가 진행되는 동안 두 번째 탭이 작동하지 않습니다. PerformSelectorInBackground를 사용했지만 도움이되지 않습니다 ?? 어느 누구도 나를 도울 수 있습니까 ????

영어가 취약합니다. 제 문제를 이해할 수 있습니까?

Yuva.M

답변

0

NSThread하여 무거운 프로세스를 실행합니다. here에서

발췌문 :

- (IBAction) startThreadButtonPressed:(UIButton *)sender { 

    [NSThread detachNewThreadSelector:@selector(startTheBackgroundJob) toTarget:self withObject:nil]; 

} 

- (void)startTheBackgroundJob { 

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
    // wait for 3 seconds before starting the thread, you don't have to do that. This is just an example how to stop the NSThread for some time 
    [NSThread sleepForTimeInterval:3]; 
    [self performSelectorOnMainThread:@selector(makeMyProgressBarMoving) withObject:nil waitUntilDone:NO]; 
    [pool release]; 

} 

- (void)makeMyProgressBarMoving { 

    float actual = [threadProgressView progress]; 
    if (actual < 1) { 
     threadProgressView.progress = actual + 0.01; 
     [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(makeMyProgressBarMoving) userInfo:nil repeats:NO]; 
    } 

} 
+0

덕분에 내 친구 .. –

+0

가 당신을 도와나요? –

+0

나중에 내 하루가 절약되었습니다. 고마워. –

관련 문제