I have 2 classes. Son
inherits from Dad
. (Note code has been simplified)
@interface Dad : NSObject
@interface Son : Dad
Dad Class
- (void)setupSession
{
dadSession = [NSURLSession config:config delegate:self delegateQueue:mainQueue];
// PROBLEM: self == Son, not Dad
}
Son class
- (void)startDadSession
{
[super setupSession];
}
then someone somewhere calls...
[son startDadSession];
I want the Dad class to be its own delegate for its session, but when I call [super setupSession]
from the Son
class, when the execution goes into the Dad class self == Son
.
Is there a way to have self
not be the instance of the Child class here?