I am trying to do my own program for answering the questions via yes and no. But I have still one thread and I do not know what to do with it. I tried to express that my UIView (textfield) is not empty but xcode do not like the way I have done that. I am beginner so maybe there are more mistakes. I would appreciate every help 🙂
- (IBAction)generateAnswer:(UIButton *)sender {
if (_typeQuestion != nil) {
_showAnswer.text = _answer;
}
}
If you just want to know if typeQuestion is not empty, and _typeQuestion is an UITextfield, then just use:
Note:
isEqualToStringcompares two NSStrings. In order to get the NSString from the text field, you must use.text. Therfore ->_typeQuestion.text