0
나는 그들의 구현 파일에서이 같은 선언을 사용하여 수십 명의 사람을 보았다 다음과 같은 클래스 확장 :선언
@interface ViewController()
{
@property (nonatomic, strong) UIPopoverController *popoverController;
@property (nonatomic, strong) NSString *currentPick;
….
}
@implementation ViewController
@synthesize popoverController;
@synthesize currentPick;
...
나는이 경우에 약간 혼란 스럽다.
미리 감사드립니다.
그래, Java의 청각 instace 변수에서 혼란스러워, objective-c의 조건으로 번역하면 속성이 인스턴스 변수가 될 것이므로, 분명히 아닙니다. 장점은 클래스 확장에서 속성을 정의하면 getter 및/또는 setter 메서드를 자동으로 설정할 수 있다는 것입니다. – Moonstar
관련 : [현대 ObjC에 ivars 넣을 위치?] (http://stackoverflow.com/q/13566862) –