一、Keys and Key Paths
Key
@interface Student : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) NSInteger *age;
@end
Student *student = [[Student alloc] init];
[student setValue:@"magic" forKey:@"name"];
Key Paths
@interface Teacher : NSObject
@property (nonatomic, strong) Student *stu;
@property (nonatomic, copy) NSString *name;
@end
Teacher *teacher = [[Teacher alloc] init];
teacher.stu = [[Student alloc] init];
[teacher setValue:@"magic" forKeyPath:@"stu.name"];
二、Collection Operators