我正在嘗試創建一個UILabel,它會在用戶等待時通知用戶正在進行的操作。但是UILabel總是延遲其文本更新,直到系統再次空閒。如何立即更新UILabel?
的過程:
[infoLine performSelectorOnMainThread:@selector(setText:) withObject:@"Calculating..." waitUntilDone:YES];
[distanceManager calc]; // Parses a XML and does some calculations
[infoLine performSelectorOnMainThread:@selector(setText:) withObject:@"Idle" waitUntilDone:YES];
不應該waitUntilDone做到這一點 「馬上」?
你嘗試到指定waitUntilDone爲NO? – vodkhang 2010-08-31 08:30:58
是的,也嘗試過... – ciffa 2010-08-31 08:44:18
你是在主UI線程還是從其他線程執行此操作? – hotpaw2 2010-08-31 08:49:03