如何访问对象ID标识属性 [英] How to access Object ID Identity attribute

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

问题描述

HI人。

第1部分。
在身份选项卡下的IB中,您可以找到名为对象ID的属性。
我找不到从代码中获取此ID的方法。哦,我知道标签属性,但它不是我需要的。

Part 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.

第2部分。
我基本上想获得一个唯一的对象ID触及了这个场景的UIComponent。我已经有了UITouch对象。

Part 2. 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.

您想要使用标签,或者是房产/出口。

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

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

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