I'm trying to calculate the total height of subviews in a UIScrollView:
[self.subviews valueForKeyPath:@"[email protected]"];
But that throws the following:
'NSUnknownKeyException', reason: '[<NSConcreteValue 0x4b10170> valueForUndefinedKey:]: this class is not key value coding-compliant for the key size.'
I've tried placing the @sum
operator in various places in that path, all with the same result.
Of course I could just do this with a loop, but I'm specifically curious about the KVC solution -- I assume it's possible and I'm just doing it wrong. What's the proper path?