本文介绍了UIView viewWithTag 0问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IB中查看我有很多项目(包括视图本身)。只有一个项目有标记0,但是下面的行适用于任何UITextBox,然后是带有标记0的那个。注意只有一个UITextBox有标记0,原因:

On view in IB I have numerous items (including view itself). ONLY one item has tag 0, yet following line works for ANY UITextBox other then the one with tag 0. Note that only ONE UITextBox has tag 0, why:


(UITextField *) [self.view  viewWithTag:0]).text = @"foo";

有趣的是,当收到标签为0的元素的触发事件时,我可以毫无问题地获得标签0的值。

Interesting that when triggered event received for the element with tag 0, I can get value of Tag 0 with no problem.

查找标签0元素是否有限制?

Is there a limitation to look for tag 0 elements?

推荐答案

这篇关于UIView viewWithTag 0问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 17:50