inheritance - Objective-C: Cast super instance variable in subclass? -
inheritance - Objective-C: Cast super instance variable in subclass? -
in objective-c, in definition of subclass (perhaps in interface file), possible cast instance variable (ivar) that's inherited super class?
i want because i've defined superclass's ivar nsobject *session, , want cast subclasse's ivar facebook *session, don't have cast every time i'm sending message facebook instances respond nsobject instances don't.
there no way alter type of superclass interface variable, 1 thing add together getter method, such as
- (facebook *) getsession { homecoming (facebook *)[self session]; } objective-c inheritance casting instance-variables ivar
Comments
Post a Comment