Answer the question
In order to leave comments, you need to log in
Xcode 5: New Label.text is being written over old content
I'm trying to change the text of the Label, but for some reason it happens like this. The most stupid thing is that I repeat the actions of the course teacher and do the same.
FMViewController.m:
#import "FMViewController.h"
@interface FMViewController ()
@end
@implementation FMViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)buttonPressed:(UIButton *)sender {
self.titleLabel.text = @"Hello, Class";
}
@end
#import <UIKit/UIKit.h>
@interface FMViewController : UIViewController
@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
- (IBAction)buttonPressed:(UIButton *)sender;
@end
Answer the question
In order to leave comments, you need to log in
The most banal and the first thing that comes to mind:
do you have exactly 1 label?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question