# # # Objective-c KVC Self-active conversion type research
Apple is very kind, KVC time to help us do some type of conversion, the law posted, for the participants to participate in the test
@interface Entity: NSObject
@property (nonatomic, copy) NSString * str;
@property (nonatomic, assign) int i1;
@property (nonatomic, assign) int i2;
@property (nonatomic, assign) int i3;
@property (nonatomic, assign) float f1;
@property (nonatomic, strong) NSNumber * num;
@property (nonatomic, assign) BOOL b1;
@property (nonatomic, assign) BOOL b2;
@property (nonatomic, assign) BOOL b3;
@property (nonatomic, strong) NSDate * date1;
@property (nonatomic, assign) NSTimeInterval t1;
@end
// numeric strings can be converted to numeric types
[obj setValue: @ "2.4" forKey: @ "i1"];
// Non-numeric strings are not recognized
[obj setValue: @ "a" forKey: @ "i2"];
// Only know the number of special symbols
[obj setValue: @ "2014 10-24" forKey: @ "i3"];
// This conversion used to be of type NSNumber
[obj setValue: @ 1 forKey: @ "str"];
[obj setValue: @ 1.23 forKey: @ "f1"];
// Go to NSString
[obj setValue: @ "99" forKey: @ "num"];
//> = 1.0 is true, below 1.0 is false
[obj setValue: @ 0.9 forKey: @ "b1"];
//> = 1.0 is true, below 1.0 is false
[obj setValue: @ "1.1" forKey: @ "b2"];
// true TRUE yes YES false FALSE no NO can recognize
[obj setValue: @ "TRUE" forKey: @ "b3"];
// turn to NSTring
[obj setValue: @ "2014-10-24" forKey: @ "date1"];
// do not know
[obj setValue: @ "2014-10-24" forKey: @ "t1"];
// in conclusion
// Numeric string to numeric can be converted to numeric
// class to class direct assignment without conversion
Study on the type of self-active conversion of objective-c KVC