索引 UILabels Objective-C
我正在编写 iPhone 应用程序,需要 UILabels 方面的帮助。 一个例子: 我有 10 个标签,名为 Label1、Label2、Label3 等。 和 Label1.text = @"1"、Label2.text=@"2" 等。 有没有办法在 for 循环中做到这一点。喜欢 for(int i = 1, i<11,i++){Labeli.text = ...} ? 谢谢你的帮助。
i am programming an iphone application and need help with the UILabels.
An example:
I have 10 Labels named Label1, Label2, Label3 etc.
and Label1.text = @"1", Label2.text=@"2" etc.
is there a way to do it in a for-loop. Like
for(int i = 1, i<11,i++){Labeli.text = ...} ?
thx for helping.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为每个标签设置标签并按如下方式访问值,
否则执行以下操作,
Set tag for each label and access the value as follows,
or else do as follows,
这是正确的 for 循环:
然后,稍后使用
[myMutableArray objectAtIndex:index]; 访问每个标签
Here's the proper for loop:
Then, later, access each label with
[myMutableArray objectAtIndex:index];