Ok, I'm understanding the basic concepts in OOP. In Objective C I know how to create a class, write methods for that class and basic message passing.
I guess my confusion lies within the semantics. When I create a class, I do the following:
Code:
@interface Fraction : NSObject //NSObject is the parent class to our Fraction class
{
// delcare instance variables for our class
int numerator;
int denominator;
int fractionType;
}
//method headers
- (void) myPrintMethod;
- (void) mySetNumeratorMethod: (int) n;
- (void) mySetDenominatorMethod: (int) d;
@end
So, when a class is created, we assign it to NSObject. I think that's what's throwing me. Our class is a child of the parent NSObject, so what is the difference between classes and objects?