我正在Xcode中创建一个应用程序,我希望将变量“selectedAnswer”设置为我的按钮answer1的标题/文本。 answer1是IBOutlet和IBAction。
答案 0 :(得分:1)
[answer1 setTitle:selectedAnswer forState:UIControlStateNormal];
答案 1 :(得分:1)
尝试以下
NSString *selectedAnswer = @"Title";
[answer1 setTitle: selectedAnswer forState: UIControlStateNormal];
答案 2 :(得分:0)
编写此代码:
[answer1 setTitle:selectedAnswer forState:UIControlStateNormal];