0
當我的iOS應用程序被激活時,點擊應用程序支持的文件(FTA)時,我想在applicationDidBecomeActive中顯示一個模態視圖。由於我想控制回來,當模態視圖被解散時,我使用NSRunLoop和一個標誌來檢測視圖被解散。請參閱附件中的代碼。當調用[NSRunloop runUntilDate]時,我的視圖顯示在當前視圖的後面,並且不響應鍵盤/鼠標操作。任何想法正在發生。在applicationDidBecomeActive中調用NSRunLoop方法會導致系統不響應
[CODE]
- (void) applicationDidBecomeActive:(UIApplication *)application {
//App activated due to file selection in an email attachment, display modal dialog
if (fileSelected)
{
RSAImportViewController *s = [[RSAImportViewController alloc] initWithNibName:@"RSAImportViewController_iPad" bundle:nil];
UINavigationController* rNC = [[UINavigationController alloc] initWithRootViewController:s];
[rNC setModalPresentationStyle:UIModalPresentationFormSheet];
[rNC setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[nav presentModalViewController:rNC animated:YES];
// wait for modal view to be dismissed, the modal view is dismissed when ok/cancel
// buttons are clicked.
while (s.completion == requestRunning) {
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]];
}
[s dismissKeyboard];
// Do further processing
return;
}
謝謝!這有助於幫助 –
酷:)因爲我看到你是新手,所以如果它解決了你的問題,不要忘了點擊答案旁邊的複選標記,將你的問題標記爲已解決,讓其他人知道。 – AliSoftware