Hey Dave -
Usually wanting to do something like this points to some design flaw,
but if you really want to invoke classA's implementation there are a
number of ways to do it.
One way would be to put a category on MyClassB like this:
@implementation MyClassB(PassThrough)
- (void)aboutMySuperClass {
[super about Me];
}
@end
Then from "-(void) someMethod:(MyClassB*) myClass" invoke "[myClass
aboutMySuperClass]".
Good Luck -
Jon Hess
You could put a category on MyClassB
On May 7, 2009, at 1:37 PM, David Alter wrote:
In Objective-C 1.0 (not 2.0 ) is there a way to call a super class
method if
I have a reference to the class
See bellow
@interface MyClassA : NSObject {
}
-(void) aboutMe ;
@end
@implementation MyClassA
-(void) aboutMe ;
{
NSLog(@"I'm Class A");
}
@end
@interface MyClassB :MyClassA {
}
-(void) aboutMe ;
@end
@implementation MyClassB
-(void) aboutMe ;
{
NSLog(@"I'm Class B");
}
@end
-(void) someMethod:(MyClassB*) myClass
{
//I want to call MyClassB's super of aboutMe. This should output
"I'm Class
A"
}
thanks for the help
-dave
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jhess%40apple.com
This email sent to [email protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]