Possible Duplicate:
Properties and Instance Variables in Objective-C 2.0
I wrote the codes below, both worked on xcode 3/ios4 and xcode 4/ios5
#import <UIKit/UIKit.h>
@interface testViewController : UIViewController {
NSString *s;
}
@property (retain ,nonatomic) NSString *s;
@end
the one without variables declaration
#import <UIKit/UIKit.h>
@interface testViewController : UIViewController {
}
@property (retain ,nonatomic) NSString *s;
@end
and
#import <UIKit/UIKit.h>
@interface testViewController : UIViewController {
NSString *s;
}
what is the difference between writing with/without variables declaration
As I know @property means replacing/simplfying the method setter/getter of the property. Does the variable declaration in { } means private property that can not be accessed outside testViewController?