我有用於彈出設置屏幕的導航界面,每次使用按設置按鈕。ios:使用modalTransitionsytle屬性導航到另一個屏幕,崩潰應用程序
@interface Navigation : UINavigationController
{
}
-(void)popToMainMenuAnimated:(BOOL)animated;
//.m file
-(void)popToMainMenuAnimated:(BOOL)animated
{
UIViewController *element;
for(element in self.viewControllers)
{
if([element isKindOfClass:[MainSettingClass class]]){
self.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:element animated:YES]
}
}
}
應用程序崩潰與下面的異常。
*因未捕獲異常'NSInvalidArgumentException'而終止應用程序,原因:'應用程序試圖以模態方式呈現活動控制器。' *第一次撥打電話堆棧:
注意:這不是根屏幕,而是我的應用程序的第3個屏幕。在調試
我按照建議做了更改,但這導致我的應用程序崩潰。以前只有轉換屬性不服從,不管我選擇哪種風格,總是以默認方式轉換。 –
Transition正在與 正確地發生[self popToViewController:element animated:YES]; 但我想過渡不是默認的,而是UIModalTransitionStylePartialCurl。 當我嘗試您的更改: [self.modalTransitionStyle = UIModalTransitionStylePartialCurl; [self presentModalViewController:element animated:YES]; 應用程序崩潰。 –
@RakeshSingh我很抱歉我的錯誤。現在怎麼樣? – Kjuly