恢复ID和标识符在故事板中设置的UITableViewCell之间有什么区别 [英] What are the differences between Restoration ID and identifier to a UITableViewCell that set in storyboard

查看:238
本文介绍了恢复ID和标识符在故事板中设置的UITableViewCell之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将 UITableViewCell 拖到 storyboard 中的tableView时,我发现有两个要设置的ID检查员。一个在Identity Inspector中( Restoration ID ),另一个在Attributes Inspector(identity)中。

When I drag a UITableViewCell to a tableView in storyboard, I find there are two ID to be set in the inspector. One is in the Identity Inspector(Restoration ID) and the other is in Attributes Inspector(identity).

它们之间的区别是什么?

What's the difference between them?

推荐答案

使用恢复ID对于状态恢复,即使您的视图看起来像退出应用时一样 - 通常用于重新创建对象。另一方面,故事板ID只是识别故事板上的对象 - 这些对象通常用于创建对象

Restoration IDs are used for state restoration, i.e. making your view look like it did when you quit the app-often used for re-creating objects. Storyboard IDs, on the other hand, simply identify objects on the storyboard-these are often used for creating objects.

这篇关于恢复ID和标识符在故事板中设置的UITableViewCell之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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