Hi Aaron,
Classes in Objective-C are similar to classes in C++: the class is broken into two files. A header file with a @interface block defines the methods available in the class and all class variables. The other file with the @implementation provides the implementation of those methods. This is sort of a legacy thing - in the "old days" the compiler could be optimized using the header files. More modern languages like Java don't break classes this way, so it can be confusing at first.
To declare member variables of a class, you should add them to the @interface defined in the .h file. Here's an example .h file that shows a class being defined with a few instance variables:
#import <Foundation/Foundation.h>
#import "PaintViewAnimation.h"
#import "Transforms.h"
@interface PaintViewZoomAnimator : NSObject {
int valueIndex;
Transforms target;
AbstractPaintView * view;
}
- (id)initWithView:(AbstractPaintView*)v targetTransforms:(Transforms)t;
- (void)start;
- (BOOL)step;
- (void)finish;
@end
This is the only way to declare member variables of a class in Objective-C. Each instance of PaintViewZoomAnimator will have three variables accessible to all of it's methods: valueIndex, target, and view. You may be able to say "int foo" elsewhere since Objective-C is really just a thin layer on top of C - but those other approaches are incorrect.
You can declare static variables as you've suggested, but that significantly changes the scope of the variable. If I declare a static variable in a the header file, the variable is accessible everywhere (providing you include or import the header file containing the definition), and there is only one copy of it. If I had two PaintViewZoomAnimators, they would share the same values for static variables. This isn't really a good object-oriented practice, so you should try to avoid it.
Hope that helps! If you're looking to get started with Objective-C, I'd recommend the Cocoa book by Aaron Hillegass - it can really help with things like this.