ではなく、それ自体Key1
として値を設定したい10.00
10
NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:
[NSDecimalNumber decimalNumberWithString:@"10.00"],
[NSDecimalNumber decimalNumberWithString:@"10.19"],nil]
forKeys:[NSArray arrayWithObjects:@"Key1",@"Key2",nil]];
NSLog(@"Value For Key1 NSDecimalNumber %@",[dict valueForKey:@"Key1"]);
NSLog(@"Value For Key1 float %f",[[dict valueForKey:@"Key1"] floatValue]);
NSLog(@"Value For Key2 NSDecimalNumber %@",[dict valueForKey:@"Key2"]);
NSLog(@"Value For Key2 float %f",[[dict valueForKey:@"Key2"] floatValue]);
これは、コンソールから取得したログです
2013-05-16 12:43:23.316 SampleTest[6569:19d03] Value For Key1 NSDecimalNumber 10
2013-05-16 12:43:23.771 SampleTest[6569:19d03] Value For Key1 float 10.000000
2013-05-16 12:43:24.263 SampleTest[6569:19d03] Value For Key2 NSDecimalNumber 10.19
2013-05-16 12:43:25.195 SampleTest[6569:19d03] Value For Key2 float 10.190000
誰でも私を助けることができますか?
前もって感謝します..