Home > DeveloperSection > Interviews > Abstract class in cocoa

Posted on    November-24-2015 7:40 AM

 iPhone iPhone  Ios  Objective C 
Ratings:
 1 Answer(s)
  282  View(s)
Rate this:

Tarun Kumar

Total Post:107

Points:535
Posted on    November-24-2015 8:40 AM

Cocoa doesn't provide anything called abstract. We can create a class abstract which gets check only at runtime, compile time this is not checked.

@interface AbstractClass : NSObject
@end
@implementation AbstractClass
+ (id)alloc{
if (self == [AbstractClass class]) {
NSLog(@”Abstract Class cant be used”);
}
return [super alloc];
@end

Don't want to miss updates? Please click the below button!

Follow MindStick