关于应在何处声明私有实例变量以及为什么要声明的约定/规则/首选项/diktat 是什么?
// someClass.h
@interface someClass : NSObject {
@private
// Here in the class declaration?
}
// ...
@end
// someClass.m
@interface someClass () {
// Here in the class extension? This seems to be obj-c's version
// of the C++ Pimpl idiom.
}
@end
@implementation someClass {
// Here in the class definition? BTW, what's the default scope here?
// Seems like it should be @private. I haven't been able to find much
// documentation about this declaration block.
}
// ...
@end
任何人都可以评论这三个部分的适当使用或指出一个好的网络资源吗?谢谢!