How do I set an instance’s property when that property is a CGRect. I want to do this:
CGRect rect = CGRectFromString(value);
[localClassObjectInstance setValue:rect forKey:key];
but the compiler doesn’t like the setValue; it says I’m sending CGRect to parameter of incompatible type ‘id’.
Thanks
You must transform a CGRect to NSValue (and viceversa):
NSValue is an object (so it’s of type “id”).
Then you can get the CGRect back with: