FROM : David Alter
DATE : Tue Jul 11 23:49:54 2006
I have a sub class of an object. The sub class has no additional
instance variables, just some additional methods. I get a pointer to
the parent object and I want to call methods available in the sub
classed objects. So I tried to case it and make the call. To this I
get "selector not recognized". Is there a way to do this? I can do
this in C++.
thanks for the help
-dave
Example bellow if needed
@interface myParent : NSObject {
int somedata
}
- (int) getSomeDataPlusOne; //
@end
In the main body of code
myParent * myObj = [[myParent alloc] init];
mySub * mysub = (mySub *) myObj;
int val = [mysub getSomeDataPlusOne]; // It chokes here with
"selector not recognized"
DATE : Tue Jul 11 23:49:54 2006
I have a sub class of an object. The sub class has no additional
instance variables, just some additional methods. I get a pointer to
the parent object and I want to call methods available in the sub
classed objects. So I tried to case it and make the call. To this I
get "selector not recognized". Is there a way to do this? I can do
this in C++.
thanks for the help
-dave
Example bellow if needed
@interface myParent : NSObject {
int somedata
}
- (int) getSomeDataPlusOne; //
@end
In the main body of code
myParent * myObj = [[myParent alloc] init];
mySub * mysub = (mySub *) myObj;
int val = [mysub getSomeDataPlusOne]; // It chokes here with
"selector not recognized"
| Related mails | Author | Date |
|---|---|---|
| David Alter | Jul 11, 23:49 | |
| Shawn Erickson | Jul 12, 00:02 | |
| David Alter | Jul 12, 00:30 | |
| Chris Suter | Jul 12, 00:40 | |
| Shawn Erickson | Jul 12, 00:41 | |
| Nir Soffer | Jul 13, 01:25 |






Cocoa mail archive

