인스턴스 변수로 바꾸려는 개체가 있습니다.왜이 개체를 인스턴스 변수로 변환 할 수 없습니까?
ZipFile *newZipFile = [[ZipFile alloc] initWithFileName:zipPath mode:ZipFileModeCreate];
을하지만이로 변경하려고 할 때 작동하지 않습니다 :이 작동
.H :
@interface PanelController : NSWindowController <NSWindowDelegate> {
ZipFile *_zipFile;
}
@property (nonatomic, assign) ZipFile *zipFile;
하는 .m :
@synthesize zipFile = _zipFile;
...
// get a syntax error here
zipFile = [[ZipFile alloc] initWithFileName:zipPath mode:ZipFileModeCreate];
편집을 : 나는 이것을 인터페이스에 넣고 @property를 제거함으로써 이것을 해결할 수 있었다 :
ZipFile *newZipFile;
나는 모든 개체에 setter 및 getters를 할당 할 수 없다고 생각합니까? 그러나 내가하는 경우 왜 작동하지 않습니다 :
ZipFile *zipFile;