hi, i need help on my cs193p hellopoly assignment 2b. i can't get my decrease & increase to function correctly. when i pressed it, the program crashes. i don't know what's wrong. can someone take a look at it please?
here is my decrease/increase function:
- (IBAction)decrease;
{
myPolygon.numberOfSides--;
// [self updateUI];
}
- (IBAction)increase
{
myPolygon.numberOfSides++;
// [self updateUI];
}
console output:
2011-07-13 23:39:07.838 HelloPoly[23044:207] -[PolygonShape numberOfSides]: unrecognized selector sent to instance 0x4e21550
2011-07-13 23:39:07.842 HelloPoly[23044:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PolygonShape numberOfSides]: unrecognized selector sent to instance 0x4e21550'
*** Call stack at first throw:
i have attached the xcode 4 project for completeness. also, i had to put my initial polygon setup in viewDidLoad instead of awakeFromNib because putting the code in awakeFromNib gave me null when i called numberOfSidesLabel.text.integerValue. Why is this happening? is because I am using xcode 4? i notice a lot of tutorial and books become incompatible with different xcode versions; is this common? thanks.