• <small id='V0nL0'></small><noframes id='V0nL0'>

    <tfoot id='V0nL0'></tfoot>

      <i id='V0nL0'><tr id='V0nL0'><dt id='V0nL0'><q id='V0nL0'><span id='V0nL0'><b id='V0nL0'><form id='V0nL0'><ins id='V0nL0'></ins><ul id='V0nL0'></ul><sub id='V0nL0'></sub></form><legend id='V0nL0'></legend><bdo id='V0nL0'><pre id='V0nL0'><center id='V0nL0'></center></pre></bdo></b><th id='V0nL0'></th></span></q></dt></tr></i><div id='V0nL0'><tfoot id='V0nL0'></tfoot><dl id='V0nL0'><fieldset id='V0nL0'></fieldset></dl></div>
      <legend id='V0nL0'><style id='V0nL0'><dir id='V0nL0'><q id='V0nL0'></q></dir></style></legend>
        <bdo id='V0nL0'></bdo><ul id='V0nL0'></ul>
      1. 使用 UIButton 传递多个标签

        时间:2023-07-06

        <small id='VG5wV'></small><noframes id='VG5wV'>

          <bdo id='VG5wV'></bdo><ul id='VG5wV'></ul>
              <tbody id='VG5wV'></tbody>
            1. <tfoot id='VG5wV'></tfoot>
              • <legend id='VG5wV'><style id='VG5wV'><dir id='VG5wV'><q id='VG5wV'></q></dir></style></legend>
                <i id='VG5wV'><tr id='VG5wV'><dt id='VG5wV'><q id='VG5wV'><span id='VG5wV'><b id='VG5wV'><form id='VG5wV'><ins id='VG5wV'></ins><ul id='VG5wV'></ul><sub id='VG5wV'></sub></form><legend id='VG5wV'></legend><bdo id='VG5wV'><pre id='VG5wV'><center id='VG5wV'></center></pre></bdo></b><th id='VG5wV'></th></span></q></dt></tr></i><div id='VG5wV'><tfoot id='VG5wV'></tfoot><dl id='VG5wV'><fieldset id='VG5wV'></fieldset></dl></div>

                  本文介绍了使用 UIButton 传递多个标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  好的,我有一个具体的情况.我正在使用自定义类来创建一些按钮,我可以使用唯一的数字设置它们的标签属性,例如:

                  OK I have a specific situation. I am using a custom class to create some buttons and I can set their tag property with unique numbers like:

                  button.tag =[NSNumber numberWithInt:[10]];
                  

                  这在我程序的另一部分非常有用,因为我可以访问这个独特的标签,例如:

                  This is very useful in another part of my program because I can access this unique tag like:

                  UIButton *clicked= (UIButton *) sender;
                  
                  ButtonTag = [NSString stringWithFormat:@"%d", clicked.tag];
                  

                  现在我想再传递一个像这样的独特属性.我正在编造这个,但这就是我的设想

                  Now I want to pass one more unique property just like this. I am making this up but this is how I envision it

                  button.tagCREATED_BY_ME =[NSNumber numberWithInt:[9000]];
                  

                  这个问题可能措辞不好,但我不知道更好,所以我称之为标签".(正确的措辞可能是元素/属性等)我如何创建一个类似的属性来像 .tag 一样发挥作用?

                  The question might be poorly worded but I don't know any better so I called it "tag".(correct wording might be element/property etc) How do I create a similar property to function just like .tag?

                  非常感谢!阿尔达

                  推荐答案

                  在你的子类/自定义按钮中,你可以添加一个字符串属性,甚至是一个整数属性,只要你觉得好.

                  In your subclassed/custom button, you can add a string property or even an integer property whichever you feel good.

                  @interface CustomButton: ....
                         ...
                         @property(strong) NSString *createdBy;
                  
                  @end
                  

                  然后你可以访问那些 aButton.createdBy

                  Then you can access those as aButton.createdBy

                  这篇关于使用 UIButton 传递多个标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iPhone 应用程序操作按钮 下一篇:uialertview 多次调用

                  相关文章

                  <i id='clWc7'><tr id='clWc7'><dt id='clWc7'><q id='clWc7'><span id='clWc7'><b id='clWc7'><form id='clWc7'><ins id='clWc7'></ins><ul id='clWc7'></ul><sub id='clWc7'></sub></form><legend id='clWc7'></legend><bdo id='clWc7'><pre id='clWc7'><center id='clWc7'></center></pre></bdo></b><th id='clWc7'></th></span></q></dt></tr></i><div id='clWc7'><tfoot id='clWc7'></tfoot><dl id='clWc7'><fieldset id='clWc7'></fieldset></dl></div>
                1. <legend id='clWc7'><style id='clWc7'><dir id='clWc7'><q id='clWc7'></q></dir></style></legend>
                  <tfoot id='clWc7'></tfoot>

                      <bdo id='clWc7'></bdo><ul id='clWc7'></ul>

                    1. <small id='clWc7'></small><noframes id='clWc7'>