草庐IT

MX_Controller

全部标签

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

iphone - 如何更改 Storyboard上 View Controller 的大小以进行编辑?

我有一个简单的问题,我花了无数个小时来解决这个问题。我如何更改XcodeStoryboard中ViewController的大小以进行编辑?我有一个很大的表单/问卷,我想放在我的ViewController上,但我根本无法使用Storyboard给我的当前大小。此外,提供的尺寸(“Inferred”、“FreeForm”、“Retina3.5”和“Retina4”)都不够大!有人能解决我的问题吗? 最佳答案 Xcode5.x+(包括6.x和7.x)从Xcode5及更高版本开始,有一个更简单的解决方案。在UIStoryboard中,您

iphone - 如何更改 Storyboard上 View Controller 的大小以进行编辑?

我有一个简单的问题,我花了无数个小时来解决这个问题。我如何更改XcodeStoryboard中ViewController的大小以进行编辑?我有一个很大的表单/问卷,我想放在我的ViewController上,但我根本无法使用Storyboard给我的当前大小。此外,提供的尺寸(“Inferred”、“FreeForm”、“Retina3.5”和“Retina4”)都不够大!有人能解决我的问题吗? 最佳答案 Xcode5.x+(包括6.x和7.x)从Xcode5及更高版本开始,有一个更简单的解决方案。在UIStoryboard中,您

iphone - "Pushing the same view controller instance more than once is not supported"异常

我正在使用以下代码检索一些消息并将它们放入我的收件箱。MyInboxVC*inboxVC=[MyInboxVCget];//uploadallthependingmessagesUINavigationController*devNavController=[[MyappMgrget]getDeveloperNavigationController];[devNavControllerpushViewController:inboxVCanimated:YES];[devNavControllersetNavigationBarHidden:NO];我得到异常Terminatingap

iphone - "Pushing the same view controller instance more than once is not supported"异常

我正在使用以下代码检索一些消息并将它们放入我的收件箱。MyInboxVC*inboxVC=[MyInboxVCget];//uploadallthependingmessagesUINavigationController*devNavController=[[MyappMgrget]getDeveloperNavigationController];[devNavControllerpushViewController:inboxVCanimated:YES];[devNavControllersetNavigationBarHidden:NO];我得到异常Terminatingap

iphone - NSGenericException',原因 : 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

所以我正在制作一个包含5个ViewController的应用程序,第一个嵌入在UINavigationController中,前4个ViewController之间的连接工作正常。然而,引入第5个ViewController打破了这一点,我收到了错误Terminatingappduetouncaughtexception'NSGenericException',reason:'PushseguescanonlybeusedwhenthesourcecontrollerismanagedbyaninstanceofUINavigationController.'我对这个第5个ViewCo