Q&A
Ask and answer questions to make information more available to wider audiences.
Isaiah Deetz @isaiahdeetz   21, Jun 2023 12:00 AM
abstract class in Cocoa
What is an abstract class in Cocoa?
answers 2
 
Answer 1
Evelyn Jeningss @jeningssevelyn   27, Jun 2023 04:59 PM

@interface AbstractClass : NSObject

@end

@implementation AbstractClass

+ (id)alloc{

if (self == [AbstractClass class]) {

NSLog(@"Abstract Class can’t be used");

}

return [super alloc];

@end
 
Answer 2
Evelyn Jeningss @jeningssevelyn   27, Jun 2023 04:59 PM
Cocoa doesn’t provide anything called abstract. It can create a class abstract that gets checked only at the runtime while it is not checked at the compile time.