가능한 중복 :
Properties and Instance Variables in Objective-C 2.0
Objective-C Properties with or without instance variables목표 C의 클래스 선언 차이점은 무엇입니까?
코드의 다음과 같은 두 가지의 차이점은 무엇입니까? 둘 다 compilable이며 나는 "올바른"모르겠어요.
@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
및
@interface JTPlayer : NSObject
@property (nonatomic, copy) NSString *userId;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) BOOL inBattle;
@end
저주, 나는 대답에 입력 한 후 중복입니다났습니다. @Sergio, 때로는 약간의 노력을하십시오 : 답변을 수락하고 검색 도구를 사용하십시오 ... – Kheldar