Say I have the following headers:
@interface SuperClass : NSObject
@interface SubClass : SuperClass
I highlight the class instance by doing:
SubClass *sc = [[SubClass alloc] init];
In my SuperClass.m:
- (id) init
{
self = [super init];
if (self != nil)
{
NSString *cString = NSStringFromClass([self class]);
}
return self;
}
Simple, right? My question is: how can I get cString to return a SuperClass, not a SubClass? Since SubClass is alloc'd / init'd, is this not possible?
Thank!
mmilo source
share