this seemed to work for me:
- (IBAction)plusMinusPressed { if ([self.display.text hasPrefix:@"-"]){ self.display.text = [self.display.text substringFromIndex:1]; } else {
self.display.text = [NSString stringWithFormat:@"-%@", self.display.text]; }
}
atesfai 2 weeks ago
Comment removed
@DeathRageUltra
Any chance you can tell me how to do the +/- part? or show me the code for it please?
S7347TH7 3 weeks ago
@palmloyal
@property(nonatomic) BOOL userHasEnteredADecimalPoint;
eltrading 3 weeks ago
I am doing the 2011 course,but cannot figure out how to prevent additional decimals from being entered. Can you please help?
palmloyal 1 month ago
Wow...and i can barely finish a "Hello World" program!
kgera95 7 months ago
Ah I finally got it finished as well :)
00melo00 7 months ago
Awesome! How did you do it? I can't really grasp the objective C language yet... :-/ I only got the first part of the assignment :P
this seemed to work for me:
- (IBAction)plusMinusPressed { if ([self.display.text hasPrefix:@"-"]){ self.display.text = [self.display.text substringFromIndex:1]; } else {
self.display.text = [NSString stringWithFormat:@"-%@", self.display.text]; }
}
atesfai 2 weeks ago
Comment removed
atesfai 2 weeks ago
@DeathRageUltra
Any chance you can tell me how to do the +/- part? or show me the code for it please?
S7347TH7 3 weeks ago
@palmloyal
@property(nonatomic) BOOL userHasEnteredADecimalPoint;
eltrading 3 weeks ago
I am doing the 2011 course,but cannot figure out how to prevent additional decimals from being entered. Can you please help?
palmloyal 1 month ago
Wow...and i can barely finish a "Hello World" program!
kgera95 7 months ago
Ah I finally got it finished as well :)
00melo00 7 months ago
Awesome! How did you do it? I can't really grasp the objective C language yet... :-/ I only got the first part of the assignment :P
00melo00 7 months ago