gpt4 book ai didi

ios - WKInterfaceTable 不可选

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:57:48 26 4
gpt4 key购买 nike

我正在使用 Xode 8 beta 6 为 watchOS 3 创建一个应用程序。使用自定义行创建 WKInterfaceTable 时,我似乎无法让选择工作。

想要执行segue,我只是想获取didSelectRowAtrowIndex打电话。

设置:

  • 我的行有一个标识符
  • 已设置“可选”复选标记
  • 我的行的自定义类已设置
  • WKInterfaceTable 有一个 IBOutlet
  • didSelectRowAt 已实现但从未被调用

下面的函数没有被调用:

override func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: Int)
{print("selected \(rowIndex)")}

我的行没有 segue 集,这似乎是其他人遇到的问题。该表是我使用推送 segue 打开的 View 的一部分

rootViewController -push-> myViewWithTableController -touchCell-> 没有任何反应

我错过了什么?

最佳答案

我在文档中搜索了转换的任何约束,但找不到。 https://developer.apple.com/documentation/watchkit/storyboard_elements/building_watchos_app_interfaces_using_the_storyboard/navigating_between_scenes

尝试了一些模式。

  • rootController -nextPage -> tableController -push (touchCell) -> NG
  • rootController -push -> tableController -push (touchCell) -> 确定
  • rootController -modal -> tableController -push (touchCell) -> NG
  • rootTableController -push (touchCell) -> 确定

如果将 tableController 的 Action SeguePush 更改为 Modal,则可以转换。

此外,在 Storyboard 中加入 segue 时,不会调用 didSelectRowAt

关于ios - WKInterfaceTable 不可选,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39331481/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com