-(void) addFractions: (Fraction*) f
{
numerator = numerator * f.denominator
+ denominator *f.numerator;
denominator = denominator *f.denominator;
}
//This is objective c-2.0
// this is the .h file for the .m above
-(void) addFractions : (Fraction*) f;
Don’t forget that you can refer to the Fraction that is the receiver of the message by its fields:numerator and denominator.On the other hand,you can’t directly refer to the instance variables of the argument fthat way.Instead,you have to obtain them by apply- ing the dot operator to f(or by sending an appropriate message to f)