Possible Duplicate:
Property vs. instance variable
Can someone tell me what is the difference between:
@interface SplitApp6DetailViewController : UIViewController <UISplitViewControllerDelegate, MKMapViewDelegate>{
sqlite3 *databaseHandle;
}
and
@interface SplitApp6DetailViewController : UIViewController <UISplitViewControllerDelegate, MKMapViewDelegate>
@property (nonatomic) sqlite3* databaseHandle;
I am confused with these 2 approaches.
Thanks!
You can use the @property approach in conjunction with @synthesize to automatically generate getters and setters.
That is the new way of doing things, it makes working with getters/setters a lot easier because you don’t have to write them yourself. The instance variable (which is defined between the braces, like in your example above) is also created for you, so there is no need to do this manually unless you want to support older versions of the system.
More information here