视图中的动态刷新 - xcode 4 / 界面生成器
我是 xcode 新手,所以请耐心等待。
我有一个设置为空白的标签,在用户单击“开始”后,我生成一个随机单词或数字并使用:
self.label.stringValue = "some_word"
来更新视图。 (顺便说一句,我正在使用 MacRuby)
但是,我想在显示最后一个单词之前快速连续显示 20 个左右的随机单词 - 只是因为现在太无聊了。 (或者,我很乐意在其位置显示动画图形 - 它被最终的随机单词取代。)
我尝试过以下方法:
100.times do
num = rand(40)
self.label.stringValue = num
end
但它不起作用。我也尝试过 .reloadData 但也无济于事。
关于如何实现这一目标有什么想法吗?
I'm new to xcode so please bear with me.
I have a label that I have set to blank, and after a user clicks 'go' I generate a random word or number and use:
self.label.stringValue = "some_word"
to update the view. (I am using MacRuby btw)
However, I would like to show 20 or so random words in quick succession before the last one is shown - just because it's too boring at the moment. (Alternatively, I'd be happy with showing an animated graphic in its place - which is replaced by the final random word.)
I've tried things like:
100.times do
num = rand(40)
self.label.stringValue = num
end
But it doesn't work. I've also tried .reloadData but to no avail as well.
Any ideas on how to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了不留下问题,请从 Macruby 邮件列表中获取:
So as not to leave the question haning, from the Macruby mailing list: