Re: Help on subclassing
Re: Help on subclassing
- Subject: Re: Help on subclassing
- From: email@hidden
- Date: Thu, 1 Dec 2005 14:39:28 -0600
I haven't tied this in xcode, so it might not work, but...
File a.h:
@interface A
@end
@protocol Foo
- (NSRect)someMethod;
@end
File a.m:
@implementation A
- (void)someOtherMethod
{
if ([self conformsToProtocol:@protocol (Foo)]) {
A<Foo> *me = (A<Foo> *)self;
NSRect rect = [me someMethod];
}
}
@end
File b.h:
@interface B <Foo>
@end
File b.m:
@implementation B
- (NSRect)someMethod
{
return ...
}
@end
I hope this isn't too far off...
Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden