UIView对象的唯一标识符 [英] Unique identifier of an UIView object

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

问题描述

我遇到以下问题.

  1. 当UIVIew发生某种触摸时,我想存储此UIView的唯一标识符(例如让我们说成objectID),以便当我再次重新打开我的应用程序时,我可以检查其中是否存在可见的UIViews是一个具有唯一ID(来自存储)的UIView.我不想将标记值存储为对象ID,因为它们可能不是唯一的并且是手动设置的.我需要获得一个由系统自动分配的唯一标识符.有什么热衷的想法吗?
  1. When a certain touch occures on a UIVIew, I want to store this UIView's unique identifier (like let's say objectID) so that when I reopen my app again I can check if in the visible UIViews there is the one UIView with the unique ID from the storage. I do not want to store the tag values as object ids because they may not be unique and they are manualy set up. I need to get a unique identifier that is automatically assign by the system. Any ideas hot to get it?

推荐答案

它们没有唯一的标识符,而每次运行应用程序时,标识符都是相同的.

They don't have a unique identifier that will be the same each time the app is run.

UIView代表什么,即某人的名字?而是存储该信息,并在下次启动应用程序时重新创建视图.

What does the UIView represent i.e. someone's name? Store that piece of information instead and re-create the view when the app next starts up.

这篇关于UIView对象的唯一标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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