typedef struct {
float x, y;
} TestFloats;
@interface TestPerson : NSObject
@property (nonatomic) TestFloats tFloats;
@end
@implementation TestPerson
@end
//KVC 访问非对象属性
TestPerson *person = [[TestPerson alloc] init];
TestFloats floatT = {1.2,1.4};
NSValue *value = [NSValue valueWithBytes:&floatT objCType:@encode(TestFloats)];
[person setValue:value forKey:@"tFloats"];
NSValue *value1 = [person valueForKey:@"tFloats"];
NSLog(@"%@",value1);
TestFloats tt;
[value1 getValue:&tt];
NSLog(@"%f-%f",tt.x,tt.y);