Given an object foo of class Foo, I want to do the following:
NSString *key = @"some key";
id myObj = [foo valueForKey: key];
and have myObj equal to foo.
Is there a way to do this without defining a category on Foo?
The following works for me, returning foo:
id myObj = [foo valueForKey: @"self"];
id myObj = foo;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With