【发布时间】:2012-11-29 10:24:18
【问题描述】:
我正在用 xcode 为 iO 编写一个应用程序。我有这样的代码:
- (void)buttonAction:(UIButton*)sender{
UIView *figure = (UIView *) [figures objectAtIndex:sender.tag];
[figure.layer setBorderWidth:2.0f];
[figure.layer setBorderColor: [UIColor greenColor].CGColor];
sleep(1);
[self cleanScreen];
}
- (void) cleanScreen {
//Some code to hide all view objects
}
我希望在 cleanScreen 函数删除项目之前,边框颜色和宽度的更改会在屏幕上反映 1 秒钟。但碰巧这些变化没有反映,花了一秒钟的时间元素都被删除了。
我想在调用 cleanScreen 之前刷新屏幕。
如何达到我想要的效果?
提前致谢!
【问题讨论】:
标签: iphone objective-c ios xcode sleep