Quellcode
- #import "ViewController.h"
- @interface ViewController ()
- @end
- @implementation ViewController
- int Wert;
- int Wert1;
- -(IBAction)Plus1:(id)sender
- {
- Wert = Wert + 1;
- Label.text = [NSString stringWithFormat:@"%i",Wert];
- }
- -(IBAction)Plus2:(id)sender {
- Wert1 = Wert1 + 1;
- Label2.text = [NSString stringWithFormat:@"%i",Wert1];
- }
- - (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)Wechsel:(id)sender{
- if (Wert == Wert1) {
- Bild.image = [UIImage imageNamed:@"Plus.png"];
- Bild.alpha = 1;
- }
- }
- @end
Ich will, dass ein Bild angezeigt wird, wenn Label1 größer ist als Label zwei und es soll alles automatisch passieren, aber ich weiss nicht wie das geht, was habe ich falsch gemacht
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von Niklay ()