0
votes

so i am getting an uncaught exception and im not sure why. this is the error i get:

2010-08-22 10:39:25.080 MayanGlyphs[10903:207] * -[UILabel setAnswerText:]: unrecognized selector sent to instance 0x4916830 2010-08-22 10:39:25.081 MayanGlyphs[10903:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UILabel setAnswerText:]: unrecognized selector sent to instance 0x4916830'

also i am getting a warning that UILabel may not respond to setAnswerText (answerText is the name of the label) even though i have created the outlet, connected it in IB, and synthesized it.

does anyone know why this might be happening?

2

2 Answers

1
votes

answerText is the name of the label? then what are you trying to do?

If you want to access the answerText object (that being an instance of UILabel) you need to use self.answerText not [UILabel setAnswerText];

If you want to change the text in the label use:

answerText.text = @"Hello, this is my text";

or similar.

0
votes

You need to do [setAnswerText setText:@"my text"]; What you are doing now is wrong. The reason you get that exception is that UILabel does not have a class method called setAnswerText:.