I just found out a few minutes ago, I could totally remove the variable declarations in @implementation section if I'm using @property and @synthesize and the program will still work.

Is this correct? bad practice? What are the pros and cons of this?

@implementation Fraction

/*{

int numerator;

int denominator;

}

*/

@synthesize numerator;

@synthesize denominator;

-(void) print {

NSLog(@"%i/%i",numerator,denominator);

}

-(double) convertToNum {

if (denominator !=0)

return (double)numerator/denominator;

else {

return NAN;

}

}

-(void) setTo: (int)n over:(int)d {

numerator = n;

denominator = d;

}

-(void) add: (Fraction *) f {

numerator = (numerator * f.denominator) + (denominator * f.numerator);

denominator = denominator * f.denominator;

}

@end