How can I run an arbitrary selector on an object, the return of which is a double? For example, I have obj A, which has method -(double)blah;
How can I do double res = [obj performSelector:@selector(blah)];? performSelector returns an id type object, so should I cast from id to NSInteger to double – that will lose precision?
Also, I do not want to use the obj’s methodSignatureForSelector (meaning, no NSMethodSignature and no NSInvocation) because it is a huge CPU drain at run-time.
Uses least memory (valueForKey: uses two temporary objects) and the msgSend method doesn’t work.