【发布时间】:2013-11-25 07:14:46
【问题描述】:
我有一个 uibutton,我正在将它的标题更改为我从 web 服务接收的数据我已经打印了 uibutton 当前磁贴和我想要显示的标题,但它没有更改按钮标题
NSString *str = [NSString stringWithFormat:@"%@",[[status objectForKey:@"detail"] valueForKey:@"goalDetailText"]];
[goalButton setTitle:str forState:UIControlStateSelected];
NSLog(@"title is %@ and value is %@",goalButton.currentTitle,str); [goalButton setTitle:str forState:UIControlStateSelected];
控制台是
2013-11-25 12:13:04.666 = sdad [3389:1003] title is Loading ... and value is Learn and practise how to minimize "emotional eating"
但问题是 uibutton 标题需要很长时间才能更改标题,但我已经检查了来自 webservice 的值不是 null 并且它的打印绝对没问题,但是 settitle 花费了太多时间。我的项目在 IOS7 上。
【问题讨论】: