Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 xcode 使用随机函数我想从一个视图切换到一个随机选择的新视图……有人能给我一些方向吗?
当前视图的新视图(随机选择)子视图或应用程序中的某个视图?
对于子视图:您可以使用每个视图的标签属性,为其分配一个值并使用它viewWithTag:来根据标签(= 之前随机生成的数字)查找视图。
viewWithTag:
对于您的应用程序的视图:您为什么要这样做?对我来说,这听起来不像是好的设计。