NSString inheritance
- by Stef
Hi, I'm doing an useless thing for my first step in Obj-C
@interface String : NSString
{
int m_isnull;
}
- (id) init;
- (int) isNull;
@end
@implementation String
- (id) init
{
self = [super init];
m_isnull=1;
return self;
}
- (int) isNull
{
return m_isnull;
}
@end
test :
String *a;
a=@"ok";
Works fine, but just 2 little questions
1) When I'm compiling I have this warning
warning: incompatible Objective-C types assigning 'struct NSString *', expected 'struct String *'
I don't know how to avoid it !?
2) a=@"ok" is a fastest way to initialize a string, but when I'm debugging, I don't stop by at my init constructor why ?