@interface AAA : NSObject
@property (nonatomic, retain) NSString * kindCode ;
@property (nonatomic, retain) long longNo;
@property (nonatomic, retain) float * kindName ;
@property (nonatomic, assign) int quantity ;
@property (nonatomic, assign) double sumInsured ;
定義以上 幾個屬性
[self setValue:@"10" forKey:@"quantity"];
NSLog(@"===%d", _quantity); //OK
[self setValue:@"10" forKey:@"kindName"]; NSLog(@"===%f", _kindName); //OK
[self setValue:@"10" forKey:@"sumInsurd"];
NSLog(@"===%f", _sumInsurd); //OK
[self setValue:@"10" forKey:@"longNo"];
// NSLog(@"===%d", _sumInsurd); //failed
//Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString longValue]: unrecognized selector sent to instance 0x15a57c'
@property (nonatomic, retain) long long longNo;