I wanted to subclass URLSessionConfiguration to set some default values for properties such as timeout intervals and httpHeaders. So I came with this custom subclass.
class CustomSessionConfiguration: URLSessionConfiguration {
init(time: TimeInterval) {
super.init()
timeoutIntervalForResource = time
}
}
But when I instantiated CustomSessionConfiguration
a crash occurred with the following reason:
-[CustomSessionConfiguration setTimeoutIntervalForResource:]: unrecognized selector sent to instance 0x6000021b76c0
It seems that my subclass didn't inherit the setter method for timeoutIntervalForResource
. Note that the same happens for other properties of the class such as httpAdditionalHeaders
.