Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface TextLabelButtonAppDelegate : NSObject {
- }
- @property (nonatomic, retain) IBOutlet UIWindow *window;
- @property (nonatomic, retain) IBOutlet UILabel *labelResult;
- @property (nonatomic, retain) IBOutlet UITextField *textAnswer;
- @property (nonatomic, retain) IBOutlet UIButton *buttonSubmit;
- - (IBAction)checkAnswer;
- @end
- @implementation TextLabelButtonAppDelegate
- @synthesize window=_window,labelResult,textAnswer,buttonSubmit;
- - (IBAction)checkAnswer {
- [textAnswer resignFirstResponder];
- if ([textAnswer.text isEqualToString:@"42"]) {
- labelResult.text = @"CORRECT!";
- } else {
- labelResult.text = @"WRONG!";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement