ios - 我可以在单击 TableViewCell 时将 View 更改为 ViewController 吗?

标签 ios objective-c

我是 Objective-C 的新手。

它有 TableViewCellViewController 上的 TableView,如下图所示。

enter image description here

我想在单击 TableViewCell 时将 View 更改为另一个 Viewcontroller

但似乎不能使用 performSegueWithIdentifier 来更改 didSelectRowAtIndexPath 中的 View 而不使用 UINavigationController ,错误日志如下:

Push segues can only be used when the source controller is managed by an instance of UINavigationController.'

当我点击 TableViewCell 时,是否有另一种方法可以将 View 更改为另一个 Viewcontroller

提前致谢。

最佳答案

在 Interface Builder( Storyboard)中单击以下内容:

enter image description here

正如调试器所说:只有当源 Controller 由 UINavigationController 的实例管理时才能使用 Push segues。' 然后您将能够推送 segues。

关于ios - 我可以在单击 TableViewCell 时将 View 更改为 ViewController 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23011214/

相关文章:

ios - AirPlay:连接到 Apple TV 时禁用音量控制

ios - 仅在 iPhone 4S 上在 postNotification 后添加观察者

ios - 方法不是公认的客观 c 方法

objective-c - 不同的 C++ include 语句在 Objective-C header 中抛出错误

ios - 初始化 AVAudioSession 时保持蓝牙声音

iOS - 在 Debug模式下连接 Xcode 的后台模式

ios - MVC : Where do I place custom UICollectionCell

iphone - 如何理解 Web 服务答案中的字符串或数组

ios - 向远程参与者发送第二个音频源

iphone - 线程正在退出我的应用程序