我想以编程的方式更改一个具有属性标题的UIButton
的标题。该按钮是在IB中创建的。我不想更改属性,只想更改标题/文本。
我尝试了下面的代码,但找不到一种更改NSAttributedString
标题的方法。
NSAttributedString *attributedString = [self.deleteButton attributedTitleForState:UIControlStateNormal];
// How can I change title of attributedString without changing the attributes?
[self.deleteButton setAttributedTitle:attributedString forState:UIControlStateNormal];
谢谢!