我创建了一个基于splitview的应用程序,在appDelegate applicationdidFinishLaunchingWithOptions方法中我显示了一个弹出窗口
(BOOL)application:(UIApplication *)applicationdidFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self.window addSubview:splitViewController.view];
[self.window makeKeyAndVisible];
ModalScreenPopup *modalpopup = [[ModalScreenPopup alloc] init];
[modalpopup setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[modalpopup setModalPresentationStyle:UIModalPresentationFullScreen];
[splitViewController presentModalViewController:modalpopup animated:NO];
[modalpopup release];
return YES;
}
(void) OpenTradeShowListingPopup
{
[splitViewController dismissModalViewControllerAnimated:YES];
TradeShowListing *modalTradeShowListing = [[TradeShowListing alloc] init];
[modalTradeShowListing setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[modalTradeShowListing setModalPresentationStyle:UIModalPresentationFullScreen];
[splitViewController presentModalViewController:modalTradeShowListing animated:YES];
[modalTradeShowListing release];
}
当我点击同步按钮时,ModalScreenPopup有2个按钮名称Synchronize并继续app我正在调用在appDelegate中声明的OpenTradeShowListingPopup方法。该方法调用另一个弹出窗口,但现在第一个模态被解散但第二个弹出窗口没有被调用。
我已经通过使用UINavigationController解决了我的问题这个帖子真的对我有很大的帮助JNOXX在Mac论坛帮助我这里的人是the link。
感谢7KV7帮助我。
答案 0 :(得分:2)
我认为这是问题
[splitViewController dismissModalViewControllerAnimated:YES];
尝试改为
[self dismissModalViewControllerAnimated:YES];