我剛剛添加了UIAlertView以確認下載操作。UIAlertView和UIActionView消失 - 應用程序處於不一致狀態
一旦用戶單擊確定,然後我調用一個方法(通過UIAlertView委託方法)以建立一個進度條UIActionSheet。 下載完成後,我關閉UIAlertView。
由於添加了UIAlertView,當UIActionSheet被取消時,我得到一個灰色的屏幕。 我無法點擊屏幕上的任何內容,但該應用似乎沒有崩潰(例如EXC_BAD_ACCESS)。
我唯一見過的類似於此(即屏幕變暗的地方)是當通知沒有被髮布在主線程(我在這裏做的)時。
有什麼建議嗎?
==== ==== UPDATE
//在我開始下載方法...
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Confirm Your Download" message:[NSString stringWithFormat:@"Do you want to download this"] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Download", nil];
alert.tag = CONFIRM_DOWNLOAD;
[alert show];
//然後,在UIAlertView中的委託方法...
- (void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (alertView.tag == CONFIRM_DOWNLOAD) {
if (buttonIndex == 0) {
DebugLog(@"Cancel download");
}
else {
DebugLog(@"Download");
[self startDownload];
}
}
}
請爲我們提供代碼。 – dasdom