Can someone explain to me when it is necessary to define your ivars as pointers?
I've seen many code samples that don't use pointers, while others do.
Can someone explain to me when it is necessary to define your ivars as pointers?
I've seen many code samples that don't use pointers, while others do.
The ivars definition depends on the type of the instance variables.
As a rule of thumb (for general purposes):
@interface ClassName : NSObject
{
// instance variable declarations
float width;
float height;
BOOL filled;
CGRect rect;
NSColor *fillColor;
NSView *view;
}
// method declarations
@end