dimanche 25 mai 2014

Simple counting app crushes


Vote count:

0




I'm new to Obj-C and trying to make simple counting application.


There is my code for increase and decrease the count. Button 'plus1' is working well, but the others are crushing my app.



-(IBAction)plus1 {
lifeCounter += 1;
self.lifeCount2.text = [NSString stringWithFormat:@"%i", lifeCounter];
}

- (IBAction)minus1 {
lifeCounter -= 1;
self.lifeCount2.text = [NSString stringWithFormat:@"%i", lifeCounter];
}

- (IBAction)plus51 {
lifeCounter = lifeCounter + 5;
self.lifeCount2.text = [NSString stringWithFormat:@"%i", lifeCounter];
}

- (IBAction)minus51 {
lifeCounter = lifeCounter - 5;
self.lifeCount2.text = [NSString stringWithFormat:@"%i", lifeCounter];
}


I receive: 'libc++abi.dylib: terminating with uncaught exception of type NSException'.



asked 24 secs ago






Aucun commentaire:

Enregistrer un commentaire