C
C
cheetahfm2014-06-08 00:47:59
Objective-C
cheetahfm, 2014-06-08 00:47:59

Xcode 5: New Label.text is being written over old content

a1e8a2533c6c480ca98455c049732b33.png2a10eb967c31400f805c46b8a2426557.png
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

FMViewController.h:
#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

1 answer(s)
M
ManWithBear, 2014-06-08
@cheetahfm

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 question

Ask a Question

731 491 924 answers to any question