I can't quite figure out what I have seen referred to as an Objective-C "class continuation". Is this / are these…
- Ivar(s) declared in the
@implementation
(.m
) file?
- Another name for a class category? (Unlikely, ASFAIK categories cannot have Ivars, period)
- Another name for a class extension?
- Something else?
That said...
- What is the scope, lifetime, and usage case for such a thing?
- Is this an ARC-specific "feature"?
- Are there specific runtime, or other requirements for their use?
- Is this an appropriate place to create an
@property
, as well? And why would this be a better place for setting ivars or properties than, say, the @interface
file / declaration?
- Why do people complicate discussions by using such specific terminology - that seems NOT to exist in any official documentation (that I could find)?
In question In Objective-C what is the difference between defining something (say a property) in the header file as opposed to the .m file?
the discussion touches on this issue, but sort of just clouds the issue further - or at least fails to provide a canonical reference / definition of the term… hence this question.
A continuation class is what Apple calls a class extension. I have seen clang call them "continuation class" and gcc uses "class continuation".
Compile this in clang or gcc:
@interface Foo : NSObject
@property int a;
@end
@interface Foo()
@property float a;
@end
... and you will get errors with the funny names.
To answer the rest of your question:
- What is the scope, lifetime, and usage case for such a thing?
Extensions are used to declare the private interface for a class. You can also use it to redeclare (refine) public property declarations.
- Is this an ARC-specific "feature"?
NO.
- Are there specific runtime, or other requirements for their use?
Class Extensions are a compile time concept and do not require a special runtime. Of course they do require a compiler that supports them (both clang and gcc do in current versions).
- Is this an appropriate place to create an @property, as well? And why would this be a better place for setting ivars or properties than, say, the @interface file / declaration?
YES. Because you might want to have private properties.
- Why do people complicate discussions by using such specific terminology - that seems NOT to exist in any official documentation (that I could find)?
Well, you know... I'd also prefer if the whole world spoke English, but for the time being I'm happy with the fact that I had to learn it in school.