【问题标题】:How to apply an NSPredicate to a custom XLForm row?如何将 NSPredicate 应用于自定义 XLForm 行?
【发布时间】:2016-07-18 11:07:44
【问题描述】:

我有一排类型为XLFormRowDescriptionTypeSelectorPush

我将row.value 设置为自定义类Agreementrow.addValidator(AgreementValidator())

我希望根据 Agreement.agree 的值(即 "Accepted""Declined")隐藏/显示另一个。

我不知道该怎么做。这是我到目前为止的位置:

other_row.hidden = NSPredicate(format:"$other_tag.value != "Accepted")

但是 other_tag 行的值是Agreement 而不是字符串。我如何与Agreement.agree比较?

【问题讨论】:

    标签: xlform


    【解决方案1】:

    试试这个。

    other_row.hidden = NSPredicate(format: "NOT $other_tag.value.agree != 'Accepted'")
    

    【讨论】:

    • 很高兴它帮助了你:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多