顯示具有 iOS multitasking 標籤的文章。 顯示所有文章
顯示具有 iOS multitasking 標籤的文章。 顯示所有文章

2011年4月8日 星期五

UIKit and thread

when dealing with UIKit class, we must be in the main thread
If we are not in the main thread,
and we want to modify label's text,
we must do following
->

[textLabel performSelectorOnMainThread:@selector(setText:)  
      withObject:@"hello" waitUntilDone:YES];

operation is iOS SDK

Add operations into operation queue and queue will manage operation for us

operation type:
1. Block operation
2. Invocation operation
3. Plane operation

operation 執行的順序和加入operation queue的順序無關

2011年3月25日 星期五

multitasking on iOS

判斷是否support多工

UIDevice *device = [UIDevice currentDevice];
if([device isMultitaskingSupported])
{
        
}