I'm doing the HelloPoly example from the Stanford class and trying to disable the increase/decrease buttons when appropriate
#import <Foundation/Foundation.h>
#import "PolygonShape.h"
@interface Controller : NSObject {
IBOutlet UIButton *decreaseButton;
IBOutlet UIButton *increaseButton;
IBOutlet UILabel *numberOfSidesLabel;
IBOutlet UILabel *nameLabel;
IBOutlet UILabel *angleLabel;
IBOutlet UILabel *minSidesLabel;
IBOutlet UILabel *maxSidesLabel;
IBOutlet PolygonShape *polygonShape;
}
-(IBAction)decrease:(id)sender;
-(IBAction)increase:(id)sender;
-(void)updateUI;
@end
and then in my Controller.m, none of the effects on the increase or decrease button take
-(IBAction)decrease:(id)sender
{
//NSLog(@"-");
polygonShape.numberOfSides--;
if (polygonShape.numberOfSides == polygonShape.minimumNumberOfSides)
decreaseButton.enabled = FALSE;
else
decreaseButton.enabled = TRUE;
self.updateUI;
increaseButton.enabled = NO;
increaseButton.highlighted = YES;
increaseButton.hidden = YES;
}