[英]How does Xcode generate the values for id attributes inside storyboard files?
例如,这是.storyboard
文件中的一些代码。
<scene sceneID="iia-3d-rxc">
<objects>
<viewController id="diG-vY-mTj" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="doE-rD-hZg"/>
<viewControllerLayoutGuide type="bottom" id="a3z-Fu-YSa"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="osR-Fj-lTh">
<!-- ... -->
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ywT-Gm-hlb" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="736" y="439"/>
</scene>
每个节点都有一个格式为***-**-***
的id
属性,其中星号用字母数字符号代替。
这是什么格式? 这些id
属性的目的是什么?它们是如何生成的?
我很难相信这些身份是随机生成的,因为在编译期间需要不必要的查找表。 例如,使用“orR-Rm-srM”标识。 它似乎是一个基数为62的数字,每个数字为a-zA-Z0-9。 给我们8个62值“位”。
汤姆
我所看到的一切都说它们基本上是随机的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.