草庐IT

control-c

全部标签

ios - 如何在 UIPageViewcontroller 中添加两个 View Controller

我在iPad上使用UIPageViewController,我需要在第一页横向显示firstviewController,在下一页横向显示ContentViewController。如果我用两个viewControllers设置NSArray应用程序在[self.pagviewControllersetViewController:]处崩溃,但出现以下异常:Thenumberofprovidedviewcontrollers(2)doesn'tmatchthenumberrequired(1)fortherequestedspinelocation(UIPageViewControll

ios - 如何在 UIPageViewcontroller 中添加两个 View Controller

我在iPad上使用UIPageViewController,我需要在第一页横向显示firstviewController,在下一页横向显示ContentViewController。如果我用两个viewControllers设置NSArray应用程序在[self.pagviewControllersetViewController:]处崩溃,但出现以下异常:Thenumberofprovidedviewcontrollers(2)doesn'tmatchthenumberrequired(1)fortherequestedspinelocation(UIPageViewControll

iOS:以编程方式呈现 View Controller

我正在使用presentViewController:animated:completion:方法转到另一个ViewController。这是我的代码:AddTaskViewController*add=[[AddTaskViewControlleralloc]init];[selfpresentViewController:addanimated:YEScompletion:nil];此代码转到另一个UIViewController但另一个Controller是空的。我一直在使用Storyboard,但现在我需要用代码来完成。 最佳答案

iOS:以编程方式呈现 View Controller

我正在使用presentViewController:animated:completion:方法转到另一个ViewController。这是我的代码:AddTaskViewController*add=[[AddTaskViewControlleralloc]init];[selfpresentViewController:addanimated:YEScompletion:nil];此代码转到另一个UIViewController但另一个Controller是空的。我一直在使用Storyboard,但现在我需要用代码来完成。 最佳答案

objective-c - 如何检查 View Controller 是否可以执行 segue

这可能是一个非常简单的问题,但在搜索时没有产生任何结果,所以这里...我正在尝试找出一种方法来检查某个ViewController是否可以在调用performSegueWithIdentifier:方法之前使用标识符XYZ执行segue。类似的东西:if([selfcanPerformSegueWithIdentifier:@"SegueID"])[selfperformSegueWithIdentifier:@"SegueID"];可能吗? 最佳答案 为了检查segue是否存在,我只是用一个try-and-catchblock将调

objective-c - 如何检查 View Controller 是否可以执行 segue

这可能是一个非常简单的问题,但在搜索时没有产生任何结果,所以这里...我正在尝试找出一种方法来检查某个ViewController是否可以在调用performSegueWithIdentifier:方法之前使用标识符XYZ执行segue。类似的东西:if([selfcanPerformSegueWithIdentifier:@"SegueID"])[selfperformSegueWithIdentifier:@"SegueID"];可能吗? 最佳答案 为了检查segue是否存在,我只是用一个try-and-catchblock将调

ios - 使用包含另一个 View 的 Navigation Controller 在 segue 中设置属性

尝试在我的segue中设置属性时遇到崩溃。它是一个UIView将属性传递给具有TableView作为其RootView的导航Controller。它应该转到我的TableViewController,但看起来它被NavigationController拦截并抛出无法识别的选择器错误。继续:-(void)prepareForSegue:(UIStoryboardSegue*)seguesender:(id)sender{if([[segueidentifier]isEqualToString:@"showItems"]){ShowItemsTableViewController*dest

ios - 使用包含另一个 View 的 Navigation Controller 在 segue 中设置属性

尝试在我的segue中设置属性时遇到崩溃。它是一个UIView将属性传递给具有TableView作为其RootView的导航Controller。它应该转到我的TableViewController,但看起来它被NavigationController拦截并抛出无法识别的选择器错误。继续:-(void)prepareForSegue:(UIStoryboardSegue*)seguesender:(id)sender{if([[segueidentifier]isEqualToString:@"showItems"]){ShowItemsTableViewController*dest

ios - 在 Swift 的导航 Controller 中弹出 2 个 View Controller

我找到了很多使用Objective-C在UINavigationController中弹出2个UIViewControllers的方法,但是当我尝试将其切换到Swift时,它似乎并没有正在工作。返回UIViewController的最佳方法是什么?任何指导将不胜感激谢谢 最佳答案 扩展我的评论,在viewControllers数组中找到倒数第二个ViewController,然后使用popToViewController来避免覆盖整个ViewController堆栈。示例(假设导航Controller有超过1个ViewControl

ios - 在 Swift 的导航 Controller 中弹出 2 个 View Controller

我找到了很多使用Objective-C在UINavigationController中弹出2个UIViewControllers的方法,但是当我尝试将其切换到Swift时,它似乎并没有正在工作。返回UIViewController的最佳方法是什么?任何指导将不胜感激谢谢 最佳答案 扩展我的评论,在viewControllers数组中找到倒数第二个ViewController,然后使用popToViewController来避免覆盖整个ViewController堆栈。示例(假设导航Controller有超过1个ViewControl