【发布时间】:2014-06-15 23:34:59
【问题描述】:
我有一个 UISwitch,它可以在切换值时更改其正上方的 UILabel 的文本。每隔一段时间(可能有 2% 的时间),文本不会改变。标签的文本被保存到文本文件中,因此我需要准确性。由于此问题是如此断断续续,因此非常难以调试。我想也许是主线程被阻塞了,但应用程序根本没有使用任何资源。有任何想法吗?提前致谢!
这里是开关的 IBAction 的一些代码。
- (IBAction)type:(id)sender {
if ([sender isOn]) {
//change label
self.typeLabel.text = @"ventless";
//change property of string to be saved into text file
self.typeString = @"ventless";
}
else{
self.typeLabel.text = @"standard";
self.typeString = @"standard";
}
【问题讨论】:
标签: ios objective-c uilabel uiswitch