Ben Wilson
Ben Wilson

Reputation: 3137

change a label and add a value

I want to change a label that is on my design I have linked them up and when i use this code it dosn't change This is in H

IBOutlet UILabel *label;
    NSInteger fred;

This is in M

fred = fred+1;
    label.text = @"Level : " +fred;

any ideas?

Upvotes: 0

Views: 51

Answers (1)

Omar Abdelhafith
Omar Abdelhafith

Reputation: 21221

Instead of

label.text = @"Level : " +fred;

use

 label.text = [NSString stringWithFormat:@"Level : %d" ,fred];

Upvotes: 4

Related Questions