【问题标题】:Identify UIAlertViews by their titles without the title being displayed通过标题识别 UIAlertViews 而不显示标题
【发布时间】:2014-01-03 00:30:01
【问题描述】:

我想知道是否可以显示UIAlertView 而不显示其非nil 标题。如果标题为nil@"",则不会显示。但在这里,我想使用标题在我的委托中调度,该委托处理所有不同的UIAlertView 按钮点击。

【问题讨论】:

    标签: ios cocoa-touch delegates uialertview


    【解决方案1】:

    如果您的委托没有指向它负责的 UIAlertViews 的指针,您可以使用每个警报视图的 tag 属性(它继承自 UIView)来区分它们。

    【讨论】:

      【解决方案2】:

      您还可以使用objc_[set|get]AssociatedObject() 将对象与您的 UIAlertView 相关联。检查<objc/runtime.h>。或者使用 Josh 的回答。

      【讨论】:

        猜你喜欢
        • 2017-12-23
        • 1970-01-01
        • 1970-01-01
        • 2016-07-23
        • 1970-01-01
        • 2021-02-27
        • 2019-04-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多