TRPerson *firstPerson = [[TRPerson alloc] initWithName:@"Maggie" withAge:18];
NSLog(@"使用点语法获取名字:%@;年龄:%d", firstPerson.name, firstPerson.age);
NSString *nameFromKVC = [firstPerson valueForKey:@"name"];
NSLog(@"使用KVC方式一获取名字:%@;年龄:%@", nameFromKVC, [firstPerson valueForKey:@"age"]);
NSLog(@"使用KVC方式获取不存在的属性值:%@", [firstPerson valueForKey:@"salary"]);
TRPerson *secondPerson = [TRPerson new];
[secondPerson setValue:@"Bob" forKey:@"name"];
[secondPerson setValue:nil forKey:@"age"];
NSLog(@"使用KVC方式一设置name:%@; 设置age:%@",[secondPerson valueForKey:@"name"], [secondPerson valueForKey:@"age"]);
TRPerson *thirdPerson = [[TRPerson alloc] initWithName:@"Jonny" withAge:20];
TRAddress *address = [TRAddress new];
thirdPerson.address = address;
[thirdPerson setValue:@"北京市-朝阳区-中国" forKeyPath:@"address.simpleAddress"];
[thirdPerson setValue:@"潘家园-xxx大厦-6层" forKeyPath:@"address.detailAddress"];
NSLog(@"简单地址:%@; 详细地址:%@",[thirdPerson valueForKeyPath:@"address.simpleAddress"], [thirdPerson valueForKeyPath:@"address.detailAddress"]);