What's the convention/rule/preference/diktat about where private instance variables should be declared and why?
// 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
Can anyone comment on the appropriate use of these three sections or point to a good web resource on this? Thanks!