Abstract classes are very common in Objective-C, and the class cluster - a widely used pattern in Cocoa - is a variation on the abstract factory pattern.
As you've noted however, there's no language facility to explicitly demarcate a method or class as abstract - this is typically done in the documentation. If you require additional safety to ensure the class is not being used in unintended ways you can do the following:
Initializer:
//Invocation of the initializer in a sub-class will not raise the exception.
if ([self class] == [MyAbstractClass class])
{
[NSException raise: . . . class is abstract - use subclass.
}
Method:
- (BOOL)someAbstractMethod
{
[NSException raise:NSInvalidArgumentException format:@"%@ is abstract",
NSStringFromSelector(_cmd)];
return NO;
}
Protocol vs Abstract Base
I disagree with statement "it is better to use a protocol" made in some other answers. While it is possible to combine an abstract base class with a protocol, it is not necessarily better.
When to Use a Protocol
Use a protocol to specify an integration contract - like a plugin architecture. An example would be a "media player", where the implementation of 'play' for a movie and an audio stream would be totally different.
When to Use an Abstract Base Class (or class cluster)
Use an abstract base class when some of the behavior between a class hierarchy is shared, and some of the implementation details vary between specific sub-types. . Its not necessarily better to use a protocol here unless you wish to communicate the intention that this set of methods is swappable for another implementation.
Class Cluster:
With a class cluster the factory methods to to obtain an instance of one of the sub-types are on the base-class itself. There are times when this makes for nicely readable and cohesive code. (Probably not relevant to your specific example, but an interesting point relating to abstract classes in Objective-C)
Class! It's a reserved Objective-C type. Name itSchoolClassor something.