如何访问对象ID身份属性? [英] How to access Object ID Identity attribute?

查看:63
本文介绍了如何访问对象ID身份属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 在IB的身份"选项卡下,您可以找到一个名为对象ID"的属性.我找不到从代码中获取此ID的方法.哦,我知道tag属性,但这不是我所需要的.

  1. In the IB under Identity tab you can find an attribute called "Object ID". I can not find a way to get hold of this ID from code. Oh, and I know about the tag attribute but it's not what I need.

我本质上想获得在屏幕上被触摸过的UIComponent的唯一对象ID.我已经有了UITouch对象.

I essentially would like to get the unique object ID for a UIComponent that was touched on the sceen. I already have the UITouch object.

推荐答案

Interface Builder中的对象ID只是IB在反序列化/序列化XIB文件时使用的内部簿记值,并且在应用程序运行时不再存在

The Object ID in Interface Builder is only an internal book-keeping value used by IB when deserializing/serializing XIB files, and does no longer exist when the Application runs.

您要使用tag,或者使用属性/插座.

You want to use tag, or alternately, a property/outlet.

这篇关于如何访问对象ID身份属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆