强制赋值
#import <Foundation/Foundation.h>
@interface Person : NSObject{
NSString *_name;
NSInteger _age;
}
@end
Person *person = [[Person alloc]init];
//设置
[person setValue:@"jiang" forKey:@"name"];
[person setValue:@18 forKey:@"age"];
//读取
NSString *string = [person valueForKey:@"name"];
NSString *string1 = [person valueForKey:@"age"];
NSLog(@"name = %@",string);
NSLog(@"age = %@",string1);