Possible Duplicate:
Properties and Instance Variables in Objective-C 2.0
Objective-C Properties with or without instance variables
What is the difference between the following two pieces of code? Both are compilable and I don't know which is "correct".
@interface JTPlayer : NSObject {
NSString *userId;
NSString *name;
BOOL inBattle;
}
@property (nonatomic, copy) NSString *userId;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) BOOL inBattle;
@end
and
@interface JTPlayer : NSObject
@property (nonatomic, copy) NSString *userId;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) BOOL inBattle;
@end