更改视图在标签中加载随机文本
我使用 arc4random 命令在三个随机选择的视图之间进行更改。在这三个视图中,我有四个标签,在单击按钮时显示随机文本。因此,当您进入随机视图时,标签为空,直到单击按钮为止。但当进入新视图时,我需要四个不同的标签已经加载了随机文本。我该怎么做?
I'm using the arc4random command to change between three randomly selected views. In those three views, I have four labels displaying random texts when clicking on a button. So the labels are empty when you go to a random view until the button is clicked. But I need the four different labels to already be loaded with the random texts when going to the new view. How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在随机选择文件的界面中放入以下代码。
在 view1.h 中
在 view1.m 中
在您的主视图中,您可以通过以下代码调用随机视图集...
In your interface of randomly selected file put the following code.
In view1.h
In view1.m
In your main view, from where you are calling the random view set following code...