Properties vs. Instance Variables

Viewed 905

I am confused as to why some classes declare a property but do not declare an ivar and vice versa.

Is it standard practice when declaring an instance variable to also declare it as a property as well?

Example:

@interface AppDelegate : NSObject <UIApplicationDelegate>
{
    UIWindow *window;
    UINavigationController *navigationController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

is just standard practice when declaring a class's ivar to make it a property as well?

I get that the @property creates its own elongated setter (and getter with @synethesize) but why does it need to be an ivar as well?

1 Answers
Related